Working with the Marks.Item list
Working with the Marks.Item list
Hi
I have a bar chart and for each bar series I tried to work with the Marks.Item list , but I dont see the marks I defined in the item list.
How exactly am I supposed to work with this .
Thanks.
I have a bar chart and for each bar series I tried to work with the Marks.Item list , but I dont see the marks I defined in the item list.
How exactly am I supposed to work with this .
Thanks.
Hello gcrnd,
Please, you could explain exactly that you want do with marks in your application, so we can suggest a solution for your problem.
Thanks,
Please, you could explain exactly that you want do with marks in your application, so we can suggest a solution for your problem.
Thanks,
Best Regards,
Sandra Pazos / Development & Support Steema Software Avinguda Montilivi 33, 17003 Girona, Catalonia Tel: 34 972 218 797 http://www.steema.com |
Instructions - How to post in this forum |
Hi
I have a stacked bar chart and I want a mark on top of each stacked bar with the total . Until now I have used the Mark of the top most series and it worked ok ( bar.Mark.Visible = true) however because of problem that you have with 0 values, I was suggested by Yeray to use a workaround which involved working with the Marks.Items of each series. but I cant seem to see the Marks that are in the Items list . I think I am not working properly with the Marks.Items list and want to know what I should do.
Thanks.
I have a stacked bar chart and I want a mark on top of each stacked bar with the total . Until now I have used the Mark of the top most series and it worked ok ( bar.Mark.Visible = true) however because of problem that you have with 0 values, I was suggested by Yeray to use a workaround which involved working with the Marks.Items of each series. but I cant seem to see the Marks that are in the Items list . I think I am not working properly with the Marks.Items list and want to know what I should do.
Thanks.
Hi qcrnd,
I'm still able to understand you. Could you change the following code to reproduce the problem?
I'm still able to understand you. Could you change the following code to reproduce the problem?
Code: Select all
private void InitializeChart()
{
tChart1.Aspect.View3D = false;
//create ans populate 4 bar series
for (int i = 0; i < 4; i++)
{
new Bar(tChart1.Chart);
tChart1.Series[i].FillSampleValues(5);
((Bar)tChart1.Series[i]).MultiBar = MultiBars.Stacked;
}
//set some of the series values as 0
tChart1.Series[1].YValues[2] = 0;
tChart1.Series[2].YValues[2] = 0;
tChart1.Series[3].YValues[4] = 0;
tChart1.Series[0].YValues[3] = 0;
//process of setting the 0 values as null to aviod drawing them
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);
}
}
}
//process for show only the last mark on each series
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 qcrnd,
Oh, now I think I understood you. Excuse me.
To change your series marks text you have two options:
- Set your desired text as your series points labels. You could do it when you add the points with the Add() method or you could loop your series and their values to change its labels:
- Use OnGetMarkText: You could assign the same method to all the series OnGetMarkText events:
And then use the event call to change the text to show as you wish:
Oh, now I think I understood you. Excuse me.
To change your series marks text you have two options:
- Set your desired text as your series points labels. You could do it when you add the points with the Add() method or you could loop your series and their values to change its labels:
Code: Select all
for (int i = 0; i < tChart1.Series.Count; i++)
{
for (int j = 0; j < tChart1.Series[i].Count; j++)
{
tChart1.Series[i].Labels[j] = "your text";
}
}
Code: Select all
for (int i = 0; i < tChart1.Series.Count; i++)
{
tChart1.Series[i].GetSeriesMark += new Series.GetSeriesMarkEventHandler(Form1_GetSeriesMark);
}
Code: Select all
void Form1_GetSeriesMark(Series series, GetSeriesMarkEventArgs e)
{
e.MarkText = "Label number " + (e.ValueIndex+1).ToString();
}
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |
I Yeray
Thanks. I tried the Labels , and it seems OK Except for one problem which I also saw before in other charts.
Sometimes the Marks , and the Labels on the x Axis get mixed up. for example a label on the x Axis can suddenly change after resize to the same string as the mark , and visa versa.
Is this a defect that you know about.?
Thanks. I tried the Labels , and it seems OK Except for one problem which I also saw before in other charts.
Sometimes the Marks , and the Labels on the x Axis get mixed up. for example a label on the x Axis can suddenly change after resize to the same string as the mark , and visa versa.
Is this a defect that you know about.?
Hi qcrnd,
Could you explain us how could we reproduce it here or could you send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Could you explain us how could we reproduce it here or could you send us a simple example project we can run "as-is" to reproduce the problem here?
You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
Thanks in advance.
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |