forked from syncfusion/ej2-aspnetmvc-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLogAxis.cshtml
63 lines (59 loc) · 2.82 KB
/
LogAxis.cshtml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
@using Syncfusion.EJ2;
@section ControlsSection{
<div class="control-section">
<div style="text-align:center">
@Html.EJS().Chart("container").Series(series =>
{
series.Type(Syncfusion.EJ2.Charts.ChartSeriesType.Line).Width(2).XName("xValue")
.Marker(mr=>mr.Visible(true)).YName("yValue1").DataSource(ViewBag.dataSource).Name("Product A").Add();
}).PrimaryXAxis(px => px.ValueType(Syncfusion.EJ2.Charts.ValueType.DateTime).EdgeLabelPlacement(Syncfusion.EJ2.Charts.EdgeLabelPlacement.Shift).LabelFormat("y")
).PrimaryYAxis(py => py.Maximum(100000).Minimum(0).MajorTickLines(mt=>mt.Width(0.1)).MinorTickLines(mt=>mt.Width(0.1)).LabelFormat("${value}")
.EdgeLabelPlacement(Syncfusion.EJ2.Charts.EdgeLabelPlacement.Shift).ValueType(Syncfusion.EJ2.Charts.ValueType.Logarithmic).Interval(1).MinorTicksPerInterval(4).Title("Profit")
).Title("Product X Growth [1995-2005]").Tooltip(tt => tt.Enable(true).Header("Profit")).LegendSettings(lg => lg.Visible(false)).Load("load").Render()
</div>
</div>
@*custom code start*@
<style>
#control-container {
padding: 0px !important;
}
</style>
<script>
var load = function (args) {
var selectedTheme = themeName ? themeName : 'Material';
args.chart.theme = (selectedTheme.charAt(0).toUpperCase() + selectedTheme.slice(1)).replace(/-dark/i, "Dark").replace(/contrast/i, 'Contrast');
args.chart.width = ej.base.Browser.isDevice ? "100%" : "60%";
};
</script>
@*custom code end*@
}
@*custom code start*@
@section Meta{
<meta name="description" content="This example demonstrates the Log Axis in ASP.NET MVC Chart control. Explore here for more details."/>
}
@*custom code end*@
@section ActionDescription{
<p>
This sample demonstrates the rendering of logarithmic axis in the chart.
</p>
}
@section Description{
<p>
Logarithmic axis uses logarithmic scale and it is very useful in visualizing when the data has values with both lower order of magnitude (eg: 10^-6) and higher order of magnitude (eg: 10^6).
To render Logarithmic axis, set <code>valueType</code> in axis to <b>Logarithmic</b>.
</p>
<p>
Tooltip is enabled in this example, to see the tooltip in action, hover a point or tap on a point in touch enabled devices.
</p>
<br>
<p>
More information on the Logarithmic axis can be found in this
<a target="_blank" href="http://ej2.syncfusion.com/documentation/chart/api-axis.html#valuetype-valuetype">documentation section</a>.
</p>
}
@section Title{
<title>ASP.NET MVC Chart Log Axis Example - Syncfusion Demos </title>
}
@section Header{
<h1 class='sb-sample-text'>Example of Log Axis in ASP.NET MVC Chart Control</h1>
}