我在我的web應用程序中使用了高圖dll,並在c#代碼中創建了圖表而不是javascript.my問題顯示在下圖中(文本向左移動,它們不在正確的位置),我該如何解決?爲什麼Highchart中的文字沒有放在正確的位置?
Highcharts charts = new Highcharts("chart");
charts.InitChart(new Chart { DefaultSeriesType = ChartTypes.Pie})
.SetPlotOptions(new PlotOptions
{
Pie = new PlotOptionsPie
{
ShowInLegend = true,
AllowPointSelect = true,
DataLabels = new PlotOptionsPieDataLabels
{
Enabled = true,
Formatter = "function() { return this.point.name +' : '+ this.percentage.toFixed(2)+' %'; }"
}
}
})
.SetTooltip(new Tooltip
{
Enabled = true,
Formatter = @"function(){return '<b>'+this.series.name +'</b> <br/>'+this.point.name + ' : ' + this.percentage.toFixed(2)+' % '; }"
})
.SetLegend(new Legend
{
Align = HorizontalAligns.Center,
VerticalAlign = VerticalAligns.Bottom,
Layout = Layouts.Horizontal,
BorderWidth = 0
});
charts.SetTitle(new Title { Text = chartTitleV + " بر اساس " + chartTitleH.TrimEnd(',').ToString() })
.SetXAxis(new XAxis { Categories = HorCategory })
.SetYAxis(new YAxis { Title = new YAxisTitle { Text = chartTitleV } })
.SetSeries(new[]
{
new Series {Name = chartTitleH.TrimEnd(',').ToString(), Data = new Data(Results)}
});