![](/img/trans.png)
[英]How can set the y and x axis of a wpf toolkit chart? something like y:kg, x:years
[英]How to set horizontal and vertical heading along with MS Chart X axis and Y axis?
我正在使用c#.Net-Windows應用程序中的圖表控件,它雖然易於使用,但自定義或設置格式有些困難,有點乏味。
我已經完成了圖表,但是我想在其中顯示水平和垂直箭頭線以及一些文本,例如,我要發布圖像:
請讓我知道圖表控件是否對此具有某些屬性。 非常感謝。
終於找到了顯示這種方式:
chart1.ChartAreas["ChartArea1"].AxisX.Title = "Test Number sorted by Date";
chart1.ChartAreas["ChartArea1"].AxisX.TitleFont = new Font("Sans Serif", 10, FontStyle.Bold);
chart1.ChartAreas["ChartArea1"].AxisY.Title = "Percentage Obtained";
chart1.ChartAreas["ChartArea1"].AxisY.TitleFont = new Font("Sans Serif", 10, FontStyle.Bold);
現在圖表看起來像:
甚至下面的代碼也有效。
<ChartAreas> <asp:ChartArea Name="ChartArea1"> <AxisX Title="Test Number Sorted By Date"></AxisX> <AxisY Title="Percentage Obtained"></AxisY> </asp:ChartArea> </ChartAreas>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.