Please suggest how would I create such a chart
https://www.dropbox.com/s/ckpd7ss7of7pjt7/chart.png
The sample browser doesn't have any sample for UltraChart, only for UltraDataChart (which is very ugly)
Hello Mitja,
From the picture you sent us it seems that you need composite chart containing a Column and a Line chart. Note, if you click on Legacy Samples link in Windows Forms Sample Browser a new form will pop up. This form contains some additional samples, including samples for UltraChart. You can find the chart samples under Data Visualization section. There you can check many chart sample as well as to look at the code behind these samples.
One more think. You can check our online documentation where you can find step by step article showing how to create composite chart as the one you need. Here is a link to this article – “Creating a Composite Chart”.
Please let me know if you have any further questions on this matter.
Sincerely,MilkoAssociate Software Developer
The article about composite chart is pretty basic, i did the same and i could have 2 column charts, but I wasn't able to also show the Line chart using the same Y axis. In my sample, all 3 chart share the same Y axis, their values are relative to only one Y axis. The chart requires a different DataType for Linear chart than for Column chart as such Ineed to create another Y axis, which makes the value not very relative to each other.
I also checked the Legacy sample, for Composite charts, there is no sample as I requested, the sample with multiple layers is not suitable for me, as the chart will just overlay each other.
Please advise.
Thx
Excelent, exactly what was needed.
Great support!
Hi Mitja,
There are several ways to set custom colors for your chart via chart’s ColorModel. One way is to apply global colors for all the chart elements. To do so you need to set ModelStyle to CustomLinear and add some colors in CustomPallete like this:
this.ultraChart1.ColorModel.ModelStyle = ColorModels.CustomLinear;this.ultraChart1.ColorModel.CustomPalette = new Color[] { Color.Blue, Color.Red };
If you need more complex appearance, e.g. gradients, for you chart you can also achieve this via series paint elements collection like this:
// Clear the paint elements collectionseries.PEs.Clear(); // Add solid colorseries.PEs.Add(new PaintElement(Color.Blue)); // Add gradient style fillseries.PEs.Add(new PaintElement( Color.Red // Fill Color , Color.White // Fill Stop Color , GradientStyle.HorizontalBump // Gradient Style ));
Note that paint element’s constructor has several overloads. More information you may find in our online documentation here.
Attached is same project I sent you last time with colors applied as you need them.
Please let me know if any further questions arise.
That seemed to work, I don't really like to calculate myself the min/max for for Y axis, but is fine, as long as it works.
The only problem left, is how to color each series into a particular color. Not each column, but he entire series.
Like in this image https://www.dropbox.com/s/ckpd7ss7of7pjt7/chart.png
Yes, you are correct. In order to show line and column chart you will need to use different chart types in your composite chart. And yes, for line chart you will need different X axis compared to the one needed for column chart. However, this should not be an issue. You can add two or more chart layers, each one of them sharing same Y axis. For column chart set the chart type of the chart layer to ColumnChart. For line chart you may set the chart type to ScatterChart and set its ConnectWithLines property to true. Then assign the necessary X axis to each layer. In order to fit the line and column values you will need to set custom range for the X axis you are using for line chart. To do so set the RangeType to Custom and RangeMin and RangeMax values accordingly like this:
AxisItem axisXLine = new AxisItem();axisXLine.RangeType = AxisRangeType.Custom;axisXLine.RangeMin = 0;axisXLine.RangeMax = 12; // this value should be equal to number of columns in your column chartaxisXLine.TickmarkInterval = 1;axisXLine.TickmarkStyle = AxisTickStyle.Smart;
Attached is a small sample project showing how to create chart as in your picture.
Please check my sample and let me know if you need any further assistance with this matter.