Hi,
I created a composite chart composed with a column chart and a scatter chart (dotted line).
At first glance, it seems to work ok (see "date offset.jpg"). The problem I have is that there's an offset between the dotted line and the column chart.
For example, if you look at the data that serves to generated the chart (see "chart data.jpg"), the dotted line value at the date "2014-03-02" should be "750" but it is "1350".
The problem I think I have is that the width between two points is not the same as the width of a column, so the offset is created from that. What properties can I adjust to solve this?
As you will see in my code, I had to create an X2 axis to be able to display the dotted line and from what I read, I cannot use the same "string" datatatype on the other axis so I created a "SemaineCount" (WeekCount in English) to use as the X value. Maybe the source of the problem resides there...
Thanks for your help,
Olivier
PS: I added an excel spreadsheet for you to have a reference between what you see on the chart and what the values are supposed to be.
Thanks for your feedback.
About your question:
Olivier Paquette said:To finish, the only thing I'm curious about is why do we need to adjust the values at runtime? (Or why wasn't it working without the FillSceneGraph?)
This task could be solve without using FillSceneGraph event, if you are using only one X axis for both layers. But this is not possible for each combination of chart types. In our scenario we have column chart which required string X axis with "GroupBySeries". Meanwhile our Scatterchart required Time axis or string X axis but with "Continues" type. That`s why we are not able to draw these two chart type using only one X axis. So when we are using two different X axis, we should synchronize it using FillSceneGraph event
Let me know if you have any further questions
Regards
Georgi, you're the man!
Thanks, it works great! And I do understand your explanation in the FillSceneGraph event.
To finish, the only thing I'm curious about is why do we need to adjust the values at runtime? (Or why wasn't it working without the FillSceneGraph?)
Thanks again,
Hare is the sample
Hello Olivier,
I made small sample for you using your C# file. I made only small modifications in the code and also I implement FillSceneGraph event. Please take a look at the attached sample for more details and explanation below:
private void manufacturingUltraChart_FillSceneGraph(object sender, Infragistics.UltraChart.Shared.Events.FillSceneGraphEventArgs e) {
// This list will contains all Box primitives. The Box primitives represent each Column in the chart List<Box> listBox = new List<Box>(); foreach (Primitive item in e.SceneGraph) { Box pl = item as Box; if (pl != null && pl.Series != null) listBox.Add(pl);
// Polyline primitive represent your line chart (build it from your scatter points). The Polyline primitive contains many points, that`s why I`m using loop to get X and Y coordinates of each point.
Polyline line = item as Polyline; if (line != null) { int k = 0; foreach (DataPoint pp in line.points) {
// I set new X coordinate for each point from Polyline primitive. To be correct our X coordinate, I`m using the X coordinate of our currect Box primitive. Also I take care about the width of the columns, so we should include this code: (listBox[k].rect.Width / 2); pp.point.X = listBox[k].rect.X + (listBox[k].rect.Width / 2); k++; } } } }
Please let me know if you have any questions.
Hi Georgi and thanks for your answer.
First, I must admit that I do not understand really much your code in the FillSceneGraph event. Could you explain it to me briefly? I understand that you're correcting at runtime the data points, but I'm not really familiar with those objects (Primitive, Polyline, Box...)
Second, please take a look at the "chart offset.jpg" image I added in my reply. You will see that:
1) The Column chart disappeared.
2) The dotted line starts with an offset (and finishes with an offset too)
I think we're on the good way to solve this problem but it may need a little tweaking again.
Thanks for your helps,