0

我使用 highchart 来显示我的月收入,所以我使用以下代码:

 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 轴应该向右更改我该怎么做?

在此处输入图像描述 此致 。

4

1 回答 1

2

将相反的值添加到

.SetYAxis(new YAxis
     {
         Opposite = true; 

和 xAxis 反转

.SetXAxis(new XAxis
     {
         Reversed = true;
于 2015-10-12T15:04:39.790 回答