Hi,
We are facing problem with showing display units in time chart, for your reference I have attached screenshot kindly look in to it.
Here I am copying my code for your reference. And I have highlighted few elements kindly notice that
var t = new TimeChart({
area: {
"height":400,
## displayUnits: [
## {unit: "1 s", name: "second"},
## {unit: "1 m", name: "minute"},
## {unit: "1 h", name: "hour"},
## {unit: "1 d", name: "day"}
## ]
## },
data:
{
name:'${phaseType}',
## units: ["s"],
dataFunction: function (from, to, step, success, fail) {
if (to == null){ to = max;}
else {to=from;}
if (from == null){ from = min;}
else {from=from-86400000;}
jQuery.ajax({
url: '${contextPath}/user/time-chart-data?componentName=${componentName}&gatewayId=${gatewayId}&phaseType=${phaseType}&from='+from+'&to='+to,
success: success,
error: fail
});
},
prefetchRatio: 0.1
},
## navigation: {
## initialDisplayPeriod: "1 day",
## initialDisplayUnit: "1 h",
## initialDisplayAnchor: "now"
## },
currentTime:{enabled:true},
valueAxis: {
"va1": {
title: "PH, units in Watts",
side: "left",
enabled: true,
}
},
legend:{
enabled:true
},
series:[
{
name: "Total average",
valueAxis: "va1",
data: { index: 1, aggregation: "avg",source: '${phaseType}',noDataPolicy:'zero' },
},
{
name: "Min",
valueAxis: "va1",
data: { index: 1, aggregation: "min",source: '${phaseType}' },
},
{
name: "Max",
valueAxis: "va1",
data: { index: 1, aggregation: "max",source: '${phaseType}' },
},
{
name:'${phaseType}',
type:"line",
valueAxis: "va1",
data:{
index:1, source: '${phaseType}',
},
style:{
fillGradient:[[-10, "blue"], [0, "lightgreen"],[30,"orange"]],
lineColor:"olive",
lineWidth: 1,
padding:[2,2]
}
}
],
container: document.getElementById("time-demo")
});