Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hide x-axis and only display y-axis as integers #37

Merged
merged 2 commits into from
Dec 4, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 70 additions & 6 deletions CentralHub.WebUI/Pages/Charts.razor
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
TItem="AggregatedMeasurements"
Items="_data1"
Name="Min - Max"
XValue="e => e.EndTime"
XValue="e => e.EndTime.ToUnixTimeMilliseconds()"
Top="e => e.WifiMax"
Bottom="e => e.WifiMin"
Stroke="@(new SeriesStroke{ Width=0 })"
Expand All @@ -28,7 +28,7 @@
Items="_data1"
Name="Median"
SeriesType="SeriesType.Line"
XValue="e => e.EndTime"
XValue="e => e.EndTime.ToUnixTimeMilliseconds()"
YValue="e => e.WifiMedian"
Stroke="@(new SeriesStroke{ Width=3, DashSpace=3, Color="#ff3300" })"
/>
Expand All @@ -37,7 +37,7 @@
Items="_data1"
Name="Mean"
SeriesType="SeriesType.Line"
XValue="e => e.EndTime"
XValue="e => e.EndTime.ToUnixTimeMilliseconds()"
YValue="e => (decimal)e.WifiMean"
Stroke="@(new SeriesStroke{ Width=3, DashSpace=3, Color="#0033ff" })"
/>
Expand All @@ -49,7 +49,7 @@
TItem="AggregatedMeasurements"
Items="_data2"
Name="Min - Max"
XValue="e => e.EndTime"
XValue="e => e.EndTime.ToUnixTimeMilliseconds()"
Top="e => e.BluetoothMax"
Bottom="e => e.BluetoothMin"
Stroke="@(new SeriesStroke{ Width=0 })"
Expand All @@ -59,7 +59,7 @@
Items="_data2"
Name="Median"
SeriesType="SeriesType.Line"
XValue="e => e.EndTime"
XValue="e => e.EndTime.ToUnixTimeMilliseconds()"
YValue="e => e.BluetoothMedian"
Stroke="@(new SeriesStroke{ Width=3, DashSpace=3, Color="#ff3300" })"
/>
Expand All @@ -68,7 +68,7 @@
Items="_data2"
Name="Mean"
SeriesType="SeriesType.Line"
XValue="e => e.EndTime"
XValue="e => e.EndTime.ToUnixTimeMilliseconds()"
YValue="e => (decimal)e.BluetoothMean"
Stroke="@(new SeriesStroke{ Width=3, DashSpace=3, Color="#0033ff" })"
/>
Expand Down Expand Up @@ -104,6 +104,38 @@
{
Opacity = new List<double> { 0.24, 1, 1 }
};

_options1.Yaxis = new List<YAxis>()
{
new YAxis()
{
Labels = new ()
{
Formatter = @"
function (val) {
return val.toFixed(0);
}
",
},
},
};

_options1.Tooltip = new Tooltip()
{
Y = new TooltipY()
{
Formatter = @"
function (val) {
return val.toString();
}
",
},
};

_options1.Xaxis = new XAxis()
{
Type = XAxisType.Datetime,
};

_options2.Chart = new Chart()
{
Expand All @@ -115,6 +147,38 @@
{
Opacity = new List<double> { 0.24, 1, 1 }
};

_options2.Yaxis = new List<YAxis>()
{
new YAxis()
{
Labels = new ()
{
Formatter = @"
function (val) {
return val.toFixed(0);
}
",
},
},
};

_options2.Tooltip = new Tooltip()
{
Y = new TooltipY()
{
Formatter = @"
function (val) {
return val.toString();
}
",
},
};

_options2.Xaxis = new XAxis()
{
Type = XAxisType.Datetime,
};
}

public void Dispose()
Expand Down
Loading