2014-02-16 60 views
0

我在我的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)} 
          }); 

enter image description here

回答

0

不要看到該頁面的HTML代碼,但我認爲這個問題可以在設置HTML元素的「目錄」屬性......至於我看到的文字被寫在阿拉伯語中,所以應該設置dir =「rtl」。

1

嘗試在工具提示選項中將useHTML設置爲true。

0

我改變方向DIV

<div dir="ltr" id="chart2" style="height: 300px"></div>

相關問題