Jump to content
Software FX Community

Customizing Point Labels


User (Legacy)

Recommended Posts

Hi.

I'd like to customize the point labels in a pie chart, in order to show only

the percentage instead of showing the percentage and the label. I'm also

getting some weird "3" label that I don't know where it came from. I can

post a screenshot if you want to.

Is there a way to do this?

Another thing, does anyone else has problems with displaying the legend box

(or legserbox) correctly? I'm having problems making it show the colored

squares for the legend, see my code below, this code is called directly on a

button click.

Oh, I forgot...I'm using eVC++ on PocketPC 2000

// START CODE SNIP

m_chart.ClearData(CD_ALLDATA);

m_chart.SetLegendBox(TRUE);

m_chart.GetPointLabelsFont().SetBold(TRUE);

m_chart.GetPointLabelsFont().SetWeight(10);

m_chart.GetAxis().GetItem(AXIS_Y).SetVisible(FALSE);

m_chart.GetAxis().GetItem(AXIS_X).SetVisible(FALSE);

m_chart.SetAxesStyle(CAS_NONE);

m_chart.OpenDataEx(COD_VALUES, 1, count_valores);

series = m_chart.GetSeries().GetItem(0);

series.SetGallery(PIE);

series.SetPointLabels(TRUE);

for (i = 0; i < count_valores; i++) {

Label_Value *item = (Label_Value

*)lista_final.GetAt(lista_final.FindIndex(i));

series.SetYvalue(i, item->m_value);

m_chart.SetLegend(i, item->m_label);

}

m_chart.CloseData(COD_VALUES | COD_SMOOTH);

// END CODE SNIP

Link to comment
Share on other sites

Hello,

You could use the PointLabelMask property. This property was accidentally

not added to the help file but you could reference the TipMask property

since it uses the same syntax and performs the same function. You can also

use the GetPointLabel event to customize PointLabels. You will need to use

this property in conjunction with the Notify property of the Y-Axis object.

Concerning the "3" label problem. No we have not experienced this issue.

If you continue to receive this problem then please send us both an image of

the problem but also a small sample that reproduces the behavior.

Concerning the issue with the legend box. My first suggestion is to pass

all data to ChartFX first. Then assign your legend labels. After you have

passed all of your labels you should then enable the legend box. Once again

if you continue to have problems then send both a screen shot as well as a

simple sample.

Justin Trask

Tech. Support

561-392-2023

"Pedro Gomes" <pedro.gomes@onthego.pt> wrote in message

news:BNGfnh5QCHA.1060@webserver1.softwarefx.com...

> Hi.

>

> I'd like to customize the point labels in a pie chart, in order to show

only

> the percentage instead of showing the percentage and the label. I'm also

> getting some weird "3" label that I don't know where it came from. I can

> post a screenshot if you want to.

>

> Is there a way to do this?

>

> Another thing, does anyone else has problems with displaying the legend

box

> (or legserbox) correctly? I'm having problems making it show the colored

> squares for the legend, see my code below, this code is called directly on

a

> button click.

>

> Oh, I forgot...I'm using eVC++ on PocketPC 2000

>

> // START CODE SNIP

> m_chart.ClearData(CD_ALLDATA);

> m_chart.SetLegendBox(TRUE);

> m_chart.GetPointLabelsFont().SetBold(TRUE);

> m_chart.GetPointLabelsFont().SetWeight(10);

> m_chart.GetAxis().GetItem(AXIS_Y).SetVisible(FALSE);

> m_chart.GetAxis().GetItem(AXIS_X).SetVisible(FALSE);

> m_chart.SetAxesStyle(CAS_NONE);

> m_chart.OpenDataEx(COD_VALUES, 1, count_valores);

> series = m_chart.GetSeries().GetItem(0);

> series.SetGallery(PIE);

> series.SetPointLabels(TRUE);

> for (i = 0; i < count_valores; i++) {

> Label_Value *item = (Label_Value

> *)lista_final.GetAt(lista_final.FindIndex(i));

>

> series.SetYvalue(i, item->m_value);

> m_chart.SetLegend(i, item->m_label);

> }

> m_chart.CloseData(COD_VALUES | COD_SMOOTH);

> // END CODE SNIP

>

>

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...