mirror of
https://github.com/pi-hole/web.git
synced 2026-04-27 20:24:10 +01:00
create utils.getGraphType() function.
also apply setting to long term graphs flip logic - only return "line" if the setting is explicitly set to "false" Signed-off-by: Adam Warner <me@adamwarner.co.uk>
This commit is contained in:
@@ -783,12 +783,9 @@ $(function () {
|
||||
var permittedColor = $(".queries-permitted").css("background-color");
|
||||
var gridColor = $(".graphs-grid").css("background-color");
|
||||
var ticksColor = $(".graphs-ticks").css("color");
|
||||
|
||||
var graphType = localStorage.getItem("barchart_chkbox") === "true" ? "bar" : "line";
|
||||
|
||||
var ctx = document.getElementById("queryOverTimeChart").getContext("2d");
|
||||
timeLineChart = new Chart(ctx, {
|
||||
type: graphType,
|
||||
type: utils.getGraphType(),
|
||||
data: {
|
||||
labels: [],
|
||||
datasets: [
|
||||
@@ -906,7 +903,7 @@ $(function () {
|
||||
if (clientsChartEl) {
|
||||
ctx = clientsChartEl.getContext("2d");
|
||||
clientsChart = new Chart(ctx, {
|
||||
type: graphType,
|
||||
type: utils.getGraphType(),
|
||||
data: {
|
||||
labels: [],
|
||||
datasets: [{ data: [] }]
|
||||
|
||||
Reference in New Issue
Block a user