【问题标题】:move x and y axis from left to right in highchart在高图中从左到右移动 x 和 y 轴
【发布时间】:2015-10-12 14:56:50
【问题描述】:

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

最好的问候。

【问题讨论】:

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


    【解决方案1】:

    将相反的值添加到

    .SetYAxis(new YAxis
         {
             Opposite = true; 
    

    xAxis 的反转

    .SetXAxis(new XAxis
         {
             Reversed = true;
    

    【讨论】:

    • 但我不确定您期望的结果。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-18
    • 2012-01-30
    • 2020-12-15
    • 1970-01-01
    相关资源
    最近更新 更多