Dears, I need to have two different range for y-axis when i'm using Dotnet highcharts in my code. here is an example in excel to show you what is the two range for y. I could add two data source to my chart already. one of them is area chart and another is line. but the line chart data range is between 80 to 90 and the area data range is between 5000 to 8000. with a single range for y-axis, the line chart cannot be display good because of different data range. can some one help me in this case? Many thanks enter image description here
Asked
Active
Viewed 937 times
1 Answers
0
I find the solution. you should use this code in your yAxis prop, and add YAxis= 1 to prop of setseries of one of your charts dataseries. it will give the priority to your charts. for example if you have 3 charts, one area, two line. then you should add YAxis = 1 to the setseries object of area chart, then add yAxis = 2 to the setseries prop of one of line charts.
.SetYAxis(new[]
{
new YAxis
{
TickInterval = 100,
Labels = new YAxisLabels
{
Formatter = "function() { return this.value +'°C'; }",
Style = "color: '#89A54E'"
},
Title = new YAxisTitle
{
Text = "Temperature",
Style = "color: '#89A54E'"
}
},
new YAxis
{
Min= 60,
Max=100,
TickInterval=2,
Labels = new YAxisLabels
{
Formatter = "function() { return this.value; }",
Style = "color: '#4572A7'"
},
Title = new YAxisTitle
{
Text = "Rainfall",
Style = "color: '#4572A7'"
},
Opposite = true
}
})

Arghavan
- 5
- 3