Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change text of legend in Chart? [duplicate]

Please see my example for the chart

enter image description here

Now, I am want to change text of the legends (don't show percent value) same as xValues of series data, such as: London, Tokyo, Paris,... (Still keep percent values in the pie).

Do you know how to do that ?

I used below codes:

int[] yValues = { 50, 20, 10, 20 }; 
string[] xValues = { "London", "Paris", "Newyork", "Tokyo"};

myChart.Series["Default"].Points.DataBindXY(xValues, yValues);
myChart.Series[0].Label = "#PERCENT{P2}";
like image 934
taibc Avatar asked Dec 02 '22 21:12

taibc


1 Answers

I found the answer by using below codes:

myChart.Series["Default"].Label = "#PERCENT";
myChart.Series[0].LegendText = "#VALX";
like image 199
taibc Avatar answered Dec 22 '22 08:12

taibc