Commit daa9f1c4 authored by LETORT Sebastien's avatar LETORT Sebastien

Update for the "created" graph. Max y value fixed, dot/line color defined.

parent 0d869acd
// AIMS : manage the metrics.html template.
// NOTE : nothing yet.
// AUTHORS : sebastien.letort@irisa.fr
"use strict";
......@@ -301,26 +300,43 @@ class CreatedPlot extends Metrics
this.type = 'line';
this.d_legend.display = false;
this.options = {
lineTension: 0
lineTension: 0,
scales: {
yAxes: [{
ticks: {
suggestedMax: this.max_y + 1
}
}]
}
};
}
_setChartjsData( l_data )
{
let l_periods = build_list( l_data, 'time_period', fmt_date );
let d_data = {}
let d_data = {};
this.max_y = 0;
for( let i=0; i<l_data.length; ++i )
{
let tp = fmt_date( l_data[i].time_period );
let val = l_data[i].n;
d_data[tp] = val; // by construction there should be no collision.
if( this.max_y < val )
this.max_y = val;
}
let color = get_random_color();
let chartjs_data = {
labels: l_periods,
datasets: [ { data:[], lineTension: 0 } ]
datasets: [{
data:[],
lineTension: 0,
backgroundColor: color,
borderColor: color,
fill: false
}]
};
for( let i=0; i<l_periods.length; ++i )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment