Hi,
When I use one numeric column in a line chart, the chart displays a horizontal line over the chart. When I try to do the same in a stacked line chart, nothing happens.
Apparently when I add another numeric column to the DataSource with the same values as the first numeric column, I get the result I want. But I don't want to do this because of two reasons:It means I should 'hack' my code with a fake column and more importantly, the description on the X-axis does not make sense anymore (a label on each side of the chart instead of one in the center).
In the documentation I found "Note that it is recommended that the data set contains two or more numeric columns so that each line can have two or more points.". So it says recommended, but not mandatory.
Can someone help me to get horizintal lines with one numeric data column in a stacked line chart? Thanks in advance.
I am using version 10.3.20103.1000.
TorX said: Still, I'm wondering why the line chart does work for 1 numeric column, but not for the stacked line/area chart. Could you or a colleague verify if this is a bug or something? And if so, will it be fixed?
Still, I'm wondering why the line chart does work for 1 numeric column, but not for the stacked line/area chart. Could you or a colleague verify if this is a bug or something? And if so, will it be fixed?
Right, I don't know why I am being ignored here. It's a shame (imho) that no one cares to answer the above mentioned question...
Could you please answer this question? If it is a bug, I think it should be addressed.
Nice workaround, thanks! However... the chart I'm working on has a variable number of points on the x-axis. The user can decide how much he wants to see. So if he chooses 5 points, the stacked line/area chart works as expected. But if he chooses 1, the mentioned problem occurs. I was thinking that maybe I could switch chart types depending on the amount of points being 1 or more. I don't think that's a good solution, but I've tried it out with your sample project and attached it as example (I changed the references to an older version though).Still, I'm wondering why the line chart does work for 1 numeric column, but not for the stacked line/area chart. Could you or a colleague verify if this is a bug or something? And if so, will it be fixed?
Hello TorX
TorX said: On a sidenote, my employer later told me he wanted the stacked lines filled with a color underneath, so I went on to use a stacked area chart instead. However, the same problem occurs there too.
DataTable dt = new DataTable(); dt.Columns.Add("Item", typeof(string)); dt.Columns.Add("Values", typeof(decimal)); dt.Rows.Add("Category 1", 10); dt.Rows.Add("Category 2", 20); dt.Rows.Add("Category 3", 30); dt.Rows.Add("Category 4", 20); dt.Rows.Add("Category 5", 15); ultraChart1.DataSource = dt;
DataTable dt = new DataTable();
dt.Columns.Add("Item", typeof(string));
dt.Columns.Add("Values", typeof(decimal));
dt.Rows.Add("Category 1", 10);
dt.Rows.Add("Category 2", 20);
dt.Rows.Add("Category 3", 30);
dt.Rows.Add("Category 4", 20);
dt.Rows.Add("Category 5", 15);
ultraChart1.DataSource = dt;
and the result will be :
Please take a look at the attached sample for more details. Please let me know if you have any questions.
Regards
Thanks for the reply, but I don't really see the explanation of why it's not possible. I already understand how the stacked line chart works, and how I should feed the data. For example, I have this in my datasource:
When I feed this to a normal line chart, I get 4 horizontal lines. But when I feed this to a stacked line chart, nothing happens. I would expect to get 4 horizontal lines with a y-value of: 5, 15, 30 and 50 (the cumulative scores).
Maybe if you can explain why I do get horizintal lines in a normal linechart, and not in a stacked line chart, I might understand.
On a sidenote, my employer later told me he wanted the stacked lines filled with a color underneath, so I went on to use a stacked area chart instead. However, the same problem occurs there too.