scale - MSChart line chart label overlapping -


i have problem... point's label this:

enter image description here

the chart must appear prettiest possible, x axis of series grow always, i'm afraid if gets more points it'll uglier.

the chart has 11 points in image, tried scale x axis 5 nothing.

any advice?

try adding smart labels series, allow set rules display of point labels without overlapping

chart1.series["default"].smartlabelstyle.enabled = true; chart1.series["default"].smartlabelstyle.allowoutsideplotarea = labeloutsideplotareastyle.partial; chart1.series["default"].smartlabelstyle.calloutlineanchorcap = lineanchorcapstyle.diamond; chart1.series["default"].smartlabelstyle.calloutlinecolor = color.red; chart1.series["default"].smartlabelstyle.calloutlinewidth = 2; chart1.series["default"].smartlabelstyle.calloutstyle = labelcalloutstyle.box; 

if doesn't produce effect want, next option using custom labels

//important: event work event handler must added initializecomponent() //  method. recommend add event using properties window in ide    private void chart1_customize(system.web.ui.datavisualization.charting.chart sender) {     // x , y axis labels collections     customlabelscollection xaxislabels = chart1.chartareas["chartarea1"].axisx.customlabels;     customlabelscollection yaxislabels = chart1.chartareas["chartarea1"].axisy.customlabels;      // change text of first y axis label     yaxislabels[0].text = "zero";      // change y axis labels     for(int labelindex = 1; labelindex < yaxislabels.count; labelindex++)     {         yaxislabels[labelindex].text = yaxislabels[labelindex].text + "�. 00'";     }      // remove each second x axis label     for(int labelindex = 0; labelindex < xaxislabels.count; labelindex++)     {         // adjust position of previous label         if(labelindex > 0)         {             xaxislabels[labelindex - 1].toposition +=                  (xaxislabels[labelindex].toposition - xaxislabels[labelindex].fromposition) / 2.0;             xaxislabels[labelindex - 1].fromposition -=                  (xaxislabels[labelindex].toposition - xaxislabels[labelindex].fromposition) / 2.0;         }          // remove label         xaxislabels.removeat(labelindex);     } } 

for more ms chart, recommend download working sample project here, contains sample code on how use different parts of ms chart, code given here sample project.


Comments

Popular posts from this blog

angularjs - ADAL JS Angular- WebAPI add a new role claim to the token -

php - CakePHP HttpSockets send array of paramms -

node.js - Using Node without global install -