Introducing compare
This commit is contained in:
parent
495c2dfeca
commit
4cd7c3d098
|
|
@ -77,6 +77,15 @@
|
|||
var chart = nv.models.multiBarChart();
|
||||
chart.yAxis.tickFormat(d3.format('.3s'));
|
||||
|
||||
{% elif viz.chart_type == 'compare' %}
|
||||
var chart = nv.models.cumulativeLineChart();
|
||||
chart.xScale(d3.time.scale());
|
||||
chart.xAxis
|
||||
.showMaxMin(false)
|
||||
.tickFormat(function (d) {return tickMultiFormat(new Date(d)); });
|
||||
chart.showLegend({{ "{}".format(viz.args.show_legend=='y')|lower }});
|
||||
chart.yAxis.tickFormat(d3.format('.3p'));
|
||||
|
||||
{% elif viz.chart_type == 'bubble' %}
|
||||
var chart = nv.models.scatterChart();
|
||||
chart.xAxis.tickFormat(d3.format('.3s'));
|
||||
|
|
|
|||
|
|
@ -313,7 +313,7 @@ class BigNumberViz(BaseViz):
|
|||
|
||||
|
||||
class NVD3TimeSeriesViz(NVD3Viz):
|
||||
verbose_name = "NVD3 - Time Series - Line Chart"
|
||||
verbose_name = "Time Series - Line Chart"
|
||||
chart_type = "nvd3_line"
|
||||
form_fields = [
|
||||
'viz_type',
|
||||
|
|
@ -373,7 +373,7 @@ class NVD3TimeSeriesViz(NVD3Viz):
|
|||
|
||||
|
||||
class NVD3TimeSeriesBarViz(NVD3TimeSeriesViz):
|
||||
verbose_name = "NVD3 - Time Series - Bar Chart"
|
||||
verbose_name = "Time Series - Bar Chart"
|
||||
chart_type = "nvd3_bar"
|
||||
form_fields = [
|
||||
'viz_type',
|
||||
|
|
@ -385,8 +385,21 @@ class NVD3TimeSeriesBarViz(NVD3TimeSeriesViz):
|
|||
]
|
||||
|
||||
|
||||
class NVD3CompareTimeSeriesViz(NVD3TimeSeriesViz):
|
||||
verbose_name = "Time Series - Percent Change"
|
||||
chart_type = "compare"
|
||||
form_fields = [
|
||||
'viz_type',
|
||||
'granularity', ('since', 'until'),
|
||||
'metrics',
|
||||
'groupby', 'limit',
|
||||
('rolling_type', 'rolling_periods'),
|
||||
'show_legend',
|
||||
]
|
||||
|
||||
|
||||
class NVD3TimeSeriesStackedViz(NVD3TimeSeriesViz):
|
||||
verbose_name = "NVD3 - Time Series - Stacked"
|
||||
verbose_name = "Time Series - Stacked"
|
||||
chart_type = "stacked"
|
||||
form_fields = [
|
||||
'viz_type',
|
||||
|
|
@ -469,10 +482,9 @@ class DistributionBarViz(DistributionPieViz):
|
|||
viz_types = OrderedDict([
|
||||
['table', TableViz],
|
||||
['line', NVD3TimeSeriesViz],
|
||||
['stacked', NVD3TimeSeriesStackedViz],
|
||||
['big_number', BigNumberViz],
|
||||
#['compare', TimeSeriesCompareViz], # TODO replace
|
||||
#['area', TimeSeriesAreaViz], # TODO replace
|
||||
['compare', NVD3CompareTimeSeriesViz],
|
||||
['area', NVD3TimeSeriesStackedViz],
|
||||
['bar', NVD3TimeSeriesBarViz],
|
||||
['dist_bar', DistributionBarViz],
|
||||
['pie', DistributionPieViz],
|
||||
|
|
|
|||
Loading…
Reference in New Issue