在高度图

时间:2015-10-12 14:56:51

标签: c# asp.net highcharts dotnethighcharts left-to-right

我使用高图来显示月收入,所以我使用这段代码:

 public Highcharts ActivityMonthlyChart(string username,string year)
        {
            //some code to get data
            Highcharts charts = new Highcharts("ActivityChart")

                .SetTitle(new Title
                    {
                        Text = ""
                    })
                .SetXAxis(new XAxis
                    {
                        Categories =
                            new[]
                                {
                                    "فروردین", "اردیبهشت", "خرداد", "تیر", "مرداد", "شهریور", "مهر", "آبان", "آذر", "دی"
                                    ,
                                    "بهمن", "اسفند"
                                }


                    })
                .SetTooltip(new Tooltip
                    {
                        Formatter = @"function() {
                                        return '<center><b>'+ this.series.name +'</b><br/>'+
                                    this.x +': '+ this.y +'تومان<center>';
                                }",
                        Crosshairs = new Crosshairs(true),
                    })
                .SetYAxis(new YAxis
                    {
                        Title = new YAxisTitle {Text = "قیمت - تومان"},
                        PlotLines = new[]
                            {
                                new YAxisPlotLines
                                    {
                                        Value = 0,
                                        Width = 10000,
                                    }
                            },

                    }
                )
                .SetSeries(new Series
                    {
                        Data = new Data(myObject)
                    });

            return charts;
        }

正如你所看到我的本地语言是波斯语所以我的图表应该改变。我的意思是y和x轴应该改为右边我该怎么做?

enter image description here 最好的问候。

1 个答案:

答案 0 :(得分:2)

将相反的值添加到

.SetYAxis(new YAxis
     {
         Opposite = true; 

和xAxis的反转

.SetXAxis(new XAxis
     {
         Reversed = true;