Are there any examples on to how to create different types of 3D bar charts, Stacked Bar similar to ChartFx. I prefer to do in PDF directly instead of using ChartFx as I lose the resolution when I save the ChartFx as PDF.
Graph and Bar Charts
Re: Graph and Bar Charts
Support · Nov 23, 2005Hello,
We do not have any example using our product in integration with ChartFX. But Following is the code showing use of our product with .netCharting and the code can be modified to work with ChartFX.
C# Code:
int [] intArray = new int[2] {100, 200};
Chart chart = new Chart();
// Set the x axis label
chart.ChartArea.XAxis.Label.Text="Quarterly Sales";
// Set the y axis label
chart.ChartArea.YAxis.Label.Text="Amount in 1000s";
// Set the bar shading effect
chart.ShadingEffect = true;
// Set he chart size.
chart.Width = 900;
chart.Height = 500;
SeriesCollection SC = new SeriesCollection();
for(int a = 0; a < 1; a++)
{
Series s = new Series();
s.Name = "Series " + a;
for(int b = 0; b < 2; b++)
{
Element element = new Element();
element.Name = "Q " + b;
element.YValue = intArray[b];
s.Elements.Add(element);
}
SC.Add(s);
}
// Set Different Colors for our Series
SC[0].DefaultElement.Color = System.Drawing.Color.FromArgb(49,255,49);
chart.SeriesCollection.Add(SC);
Bitmap bmp = chart.GetChartBitmap();
ceTe.DynamicPDF.Document document = new ceTe.DynamicPDF.Document();
ceTe.DynamicPDF.Page page = new ceTe.DynamicPDF.Page(PageSize.Letter, PageOrientation.Landscape);
page.Elements.Add( new ceTe.DynamicPDF.PageElements.Image(bmp, 125, 200, .54f));
document.Pages.Add( page );
document.DrawToWeb( this, "HelloWorld.pdf" );
In order to get a better resolution you will need to ensure that the image size is large enough to output it at the desired resolution.
Thanks,
ceTe Software Support Team