我找不到间隔属性(使用ASP.NET网页显示数据中的数据(Razor)),即使我无法将所有标签设置为可见。
我正在使用以下代码。
(chart.cshtml)
myChart = new Chart(width: 800, height: 600)
.AddTitle("Product Sales")
.AddSeries(
xValue: datap, xField: "Product",
yValues: datap, yFields: "Quantity")
.AddSeries(yValues: dataf, yFields: "Quantity2")
答案 0 :(得分:1)
答案是在主题属性中将间隔属性值设置为1,并将该主题用作图表主题
我使用了以下代码:
string theme ="<Chart>\r\n <ChartAreas>\r\n <ChartArea Name=\"Default\" _Template_=\"All\">\r\n <AxisX Interval=\"1\" />\r\n </ChartArea>\r\n </ChartAreas>\r\n <Legends>\r\n <Legend _Template_=\"All\" Alignment=\"Center\" BackColor=\"Transparent\" Docking=\"Bottom\" Font=\"Trebuchet MS, 8.25pt, style=Bold\" IsTextAutoFit =\"False\" LegendStyle=\"Row\">\r\n </Legend>\r\n </Legends>\r\n <BorderSkin SkinStyle=\"Emboss\" />\r\n</Chart>";
myChart = new Chart(width: 800, height: 600 , theme: theme)
.AddTitle("Product Sales")
.AddSeries(
xValue: datap, xField: "Product",
yValues: datap, yFields: "Quantity")
.AddSeries(yValues: dataf, yFields: "Quantity2")