Skip to content

Commit dae04bd

Browse files
authored
Added Category Axis code and few more examples
1 parent 32741a8 commit dae04bd

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

models/axes/CategoryAxis.rst

+17-3
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,22 @@ CategoryAxis
99
Example
1010
-------
1111

12+
This will add X-Axis line with 3 data point on it "Feb", "Mar", "Apr". In case you want it on the Y-Axis you can change the "Position" property to "AxisPosition.Left"
13+
14+
.. code:: csharp
15+
16+
var model = new PlotModel { Title = "Category Axis" };
17+
model.Axes.Add(new CategoryAxis { Position = AxisPosition.Bottom, ItemsSource = new string[] {"Feb","Mar","Apr"}});
18+
19+
20+
If you want to disable the zoom effect
21+
22+
.. code:: csharp
23+
24+
model.Axes.Add(new CategoryAxis {IsZoomEnabled = false, Position = AxisPosition.Bottom, ItemsSource = new string[] {"Feb","Mar","Apr"}});
25+
26+
In case you do not want any scrolling along this axis, it can be done by using "AbsoluteMaximum" and "AbsoluteMinimum"
27+
1228
.. code:: csharp
1329
14-
var model = new PlotModel { Title = "CategoryAxis" };
15-
model.Axes.Add(new LinearAxis { Position = AxisPosition.Bottom, Minimum = -20, Maximum = 80});
16-
model.Axes.Add(new LinearAxis { Position = AxisPosition.Left, Minimum = -10, Maximum = 10});
30+
model.Axes.Add(new CategoryAxis {IsZoomEnabled = false, AbsoluteMaximum = 2, AbsoluteMinimum = 0, Position = AxisPosition.Bottom, ItemsSource = new string[] {"Feb","Mar","Apr"}});

0 commit comments

Comments
 (0)