Hi there
I am using UltraChart 12.1.20121.2054 and it's fair to say I am a little confused on how to create a chart.
I am using a typed data set as the data source with the source table having the following
Date as a stringCost as a decimalCumulative Cost as a decimal
I would like my chart to appear as the followingDate as the X axisCost as the Y axisCumulative Cost as the Y2 axis
I would like the Y (cost) axis to appear a column and the Y2 (cumulative cost) to appear as a line.
I have tried creating a chart from the wizard but cannot seem to get what I want out of it.
I have some questions
What sort of chart do I want? I am guessing a composite chart with 2 layers one a column and the other a line. How do I assign a column of the data table to an axis i.e. how do I tell an axis to be built from a particular data column in the source table?
Are there any samples available that do what I want to achieve?
Thanksgeoffhop
Hello geoffhop,
Please take a look at the answers of your questions:
geoffhop said:What sort of chart do I want?
Yes, you are right. You should use a composite chart with two layers
geoffhop said:How do I assign a column of the data table to an axis i.e. how do I tell an axis to be built from a particular data column in the source table?
Please take a look at the attached sample and let me know if you have any further questions.
Regards
Here is the sample
Thanks Georgi that's great.
I have a couple of more questions though in regards the to the ColumnChart layer
1/ How do I put spaces between the columns?
2/ How do I make all columns the same color?
Thanks again
geoffhop
geoffhop said:1/ How do I put spaces between the columns?
If you are using Column chart, you could try to set the properties:
ultraChart1.ColumnChart.ColumnSpacing = 3;
ultraChart1.ColumnChart.SeriesSpacing = 4;
If you are using Composite chart, you could use ColumnChartAppearance. For example:
ColumnChartAppearance columnApp = new ColumnChartAppearance();
columnApp.ColumnSpacing = 4;
columnApp.SeriesSpacing = 3;
ColumnLayer.ChartTypeAppearance = columnApp;
You could see the result in attached screenshot below
geoffhop said:2/ How do I make all columns the same color?
There are many possible approaches to solved this task. You could set a color to your series. Another apporach could be if you are using CustomPalette. For example:
Color[] initColor = new Color[] { Color.Red, Color.Gold, Color.LightSkyBlue, Color.Orange, Color.Olive, Color.Pink, Color.Snow };
this.ultraChart1.ColorModel.CustomPalette = initColor;
Also you could handle FillSceneGraphe event and modify the colors of each Primitive.
Let me know if you have any questions.