Reputation: 7281
I use highchart for show my income in month so i use this code:
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;
}
As you can see my local language is persian so my chart should be changed .i mean the y and x axis should be changed to the right how can i do that ?
Upvotes: 0
Views: 610
Reputation: 3935
Add Opposite value to
.SetYAxis(new YAxis
{
Opposite = true;
and Reversed for xAxis
.SetXAxis(new XAxis
{
Reversed = true;
Upvotes: 2