i want to create a line Chart, where at the x-axis are the dates and on the y-axis there are the positions green(at the position of 0), yellow (1) and red (2).
How can i achieve this?
At the moment there are just the numbers. I tried it with XML, but i dont know much about it and its a little bit confusing. Can i access the single elements of the y-axis with this and convert them to text? Can i somehow implement an if else method within the Chart.AddSeries Method at axisLabel?
Controller
//XML
string t = @"
<Chart>
<ChartAreas>
<ChartArea Name=""Default"" _Template_=""All"">
<AxisY Interval=""1"">
<LabelStyle Font=""Verdana, 70px"" />
</AxisY>
</ChartArea>
</ChartAreas>
</Chart>";
var Date_min = OpenDate;
var Date_max = DateTime.Today;
var chart = new Chart(width: 300, height: 200, theme: t)
.AddSeries(
chartType: "line",
name: "Temperature",
markerStep: 2,
xValue: Date_X,
yValues: Temperature_Y) //0,1 or 2 for green, yellow and red
.SetXAxis("Date", Date_min.ToOADate(), Date_max.ToOADate())
.SetYAxis("Temperature", 0, 2.5)
.GetBytes("png");
Thank you for your help in advance.
Update
I looked through the System.Web.UI.DataVisualization.Charting Framework and did not find any additional function to solve my Problem.
I want to change the y-axis labels. Not the general Label of the y-axis but each position of it. There will be just three positions of the y-axis that have to be renamed to green, yellow and red instead of 0,1,2. Each Date of the x-axis will have a corresponding color.