Hi
I have a stacked bar with series that have a white pen width 2 and sometimes the value on the x axis can be zero. The problem I found is that in this case you still draw the series with a few pixels and it doesnt look nice.
See the image . For example in the second bar and forth bar . The last series (orange Reopen ) is drawn on top even though its value is 0 and it doesnt look nice. You will see other examples in between other series as well for example the one under bottom axis label called "sa"
HOw can I remove these artifacts.
Thanks.
Artifacts in stacked bar with series values zero
Hi qcrnd,
Yes, you are right. Note that this only happens in 2D charts. I've added it to the wish list to be fixed in future releases (TF02014154).
A workarround is to look for the 0 values and set them as null:
Yes, you are right. Note that this only happens in 2D charts. I've added it to the wish list to be fixed in future releases (TF02014154).
A workarround is to look for the 0 values and set them as null:
Code: Select all
for (int i = 0; i < tChart1.Series.Count; i++)
{
for (int j = 0; j < tChart1.Series[i].Count; j++)
{
if (tChart1.Series[i].YValues[j] == 0)
{
tChart1.Series[i].SetNull(j);
}
}
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Hi Yeray
Thanks for the reply.
Your workaround is OK but it causes a new problem. In the stacked bar we set the last series (the top most series) Marks.Visible to true so that we can have a mark above each stacked bar.
Because of your workaround , if the value of the top series is 0 and we set the value to Null, then the mark is not visible. The Mark is only visible in bars that the top series YValue is > 0.
How can I solve this issue as well.
Thanks
Thanks for the reply.
Your workaround is OK but it causes a new problem. In the stacked bar we set the last series (the top most series) Marks.Visible to true so that we can have a mark above each stacked bar.
Because of your workaround , if the value of the top series is 0 and we set the value to Null, then the mark is not visible. The Mark is only visible in bars that the top series YValue is > 0.
How can I solve this issue as well.
Thanks
Hi qcrnd,
I'm afraid that in then you should set each mark to be hidden or shown individually. For example, to show the last non null values:
I'm afraid that in then you should set each mark to be hidden or shown individually. For example, to show the last non null values:
Code: Select all
tChart1.Aspect.View3D = false;
for (int i = 0; i < 4; i++)
{
new Bar(tChart1.Chart);
tChart1.Series[i].FillSampleValues(5);
((Bar)tChart1.Series[i]).MultiBar = MultiBars.Stacked;
}
tChart1.Series[1].YValues[2] = 0;
tChart1.Series[2].YValues[2] = 0;
tChart1.Series[3].YValues[4] = 0;
tChart1.Series[0].YValues[3] = 0;
for (int i = 0; i < tChart1.Series.Count; i++)
{
for (int j = 0; j < tChart1.Series[i].Count; j++)
{
if (tChart1.Series[i].YValues[j] == 0)
{
tChart1.Series[i].SetNull(j);
}
}
}
for (int ValueIndex = 0; ValueIndex < tChart1.Series[0].Count; ValueIndex++)
{
int SeriesIndex = tChart1.Series.Count-1;
while ((SeriesIndex > 0) && (tChart1.Series[SeriesIndex].IsNull(ValueIndex)))
{
SeriesIndex--;
}
for (int k = 0; k < tChart1.Series.Count; k++)
{
tChart1.Series[k].Marks.Items[ValueIndex].Visible = k == SeriesIndex;
}
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Hi
It doesnt seem to work . I dont see any marks.
I do have another workaround that uses GetSeriesMark and decides which marks to draw and which not But I think your workaround looks better so I would like to see how to make it work.
It seems that Marks Items doesnt have any effect on my graph.
I have a feeling that there is something more missing
Thanks.
It doesnt seem to work . I dont see any marks.
I do have another workaround that uses GetSeriesMark and decides which marks to draw and which not But I think your workaround looks better so I would like to see how to make it work.
It seems that Marks Items doesnt have any effect on my graph.
I have a feeling that there is something more missing
Thanks.
Hi qcrnd,
It's strange, have you tested the code I said above in a new project with a new chart?
It's strange, have you tested the code I said above in a new project with a new chart?
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
Hi qcrnd,
I can't tell you a date. I recommend you to be aware at this forum or subscribe to our RSS news feed for new release announcements and what's fixed on them.
I can't tell you a date. I recommend you to be aware at this forum or subscribe to our RSS news feed for new release announcements and what's fixed on them.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |