Do not say anything. First, the first one to be implemented
Address: http://demos.telerik.com/aspnet-ajax/chart/examples/functionality/datatable/defaultcs.aspx
You need to reference the DLL to implement it!
However, in Microsoft's demo, the implementation is as follows:
In the first column of the table below, the color is displayed, and what I want is the name:
Code before modification:
E. chartgraphics. Graphics. fillrectangle (New solidbrush (Ser. Color ),
X-10, row * (axisfont. Height) + (point1.y), 10, axisfontsize. Height );
E. chartgraphics. Graphics. drawrectangle (new pen (bordercolor ),
X-10, row * (axisfont. Height) + (point1.y), 10, axisfontsize. Height );
Modified code:
// Set the name
Brush blackbrush = new solidbrush (color. White );
Rectanglef textarea = new rectanglef (X-80, row * (axisfont. Height) + (point1.y), 80, axisfontsize. Height );
// Set the table
E. chartgraphics. Graphics. drawrectangle (new pen (bordercolor), x-80, row * (axisfont. Height) + (point1.y ),
80, axisfontsize. Height );
E. chartgraphics. Graphics. drawstring (Ser. legendtext, new font ("", 12), new solidbrush (color. Black), textarea );
The implementation is as follows:
The results are not very satisfactory. After all, they are displayed. Another problem is that the interval between the image above and the table below is too wide, if a friend can change the chart demo to Figure 1 in the Microsoft chart demo, instruct him to modify chartdatatablehelper. CS. Thank you!