FSN#34749 Mogelijkheid voor jqplot Graphs Default options

svn path=/Website/trunk/; revision=29020
This commit is contained in:
Erik Groener
2016-04-19 12:03:07 +00:00
parent 40b8c3e134
commit 5f108c2852
2 changed files with 18 additions and 14 deletions

View File

@@ -224,7 +224,7 @@ function fac_usrrap_list_graph (model, scf_params)
, maxrows : 0
, limiet : [0,70,90,100] //limiet_arr
, report_options : rapport.graph_options || "{}"
, default_options : S("fac_graph_default_json") || "{}"
, default_options : S("udr_graph_default_json") || "{}"
, sql_orderby : "" //oRs("fac_usrgraph_orderby").Value || ""
//, sql : sql_select
};
@@ -249,7 +249,7 @@ function fac_usrrap_list_graph (model, scf_params)
var l_yas_naam = l_axes.yas[0].naam;
var l_yas_count = l_axes.yas.length;
var l_colors = (l_yas_count==1?<%=S("fac_graph_colors1")%>:<%=S("fac_graph_colors2")%>);
var l_colors = (l_yas_count==1?<%=S("udr_graph_colors1")%>:<%=S("udr_graph_colors2")%>);
var l_labels = [];
for (y=0; y<l_axes.yas.length; y++)
{
@@ -265,14 +265,14 @@ function fac_usrrap_list_graph (model, scf_params)
{
case 1: // BarChart
%>
var l_colors = (l_yas_count == 1?<%=S("fac_graph_colors1")%> : <%=S("fac_graph_colors2")%>);
var l_colors = (l_yas_count == 1?<%=S("udr_graph_colors1")%> : <%=S("udr_graph_colors2")%>);
var effectivedata = l_arr_y;
var props = { seriesDefaults:{ renderer: $.jqplot.BarRenderer
, pointLabels: { show: false }
}
, stackSeries: true
//, series:[{label:'a'},{label:'b'}]
//, legend: {show: true}
, legend: {show: true}
, title: l_init.title
, seriesColors: l_colors
, axes: { xaxis: { renderer: $.jqplot.CategoryAxisRenderer
@@ -301,11 +301,15 @@ function fac_usrrap_list_graph (model, scf_params)
case 2: // MeterGauge
%>
var l_limits = [];
if ("intervals" in report_options.seriesDefaults.rendererOptions)
if (report_options.seriesDefaults)
{
l_limits = report_options.seriesDefaults.rendererOptions.intervals;
delete report_options.seriesDefaults.rendererOptions.intervals; // Voorkom dat deze array de "effectiveprops" overschrijft.
} // De eeste waarde in het array wordt alleen gebruikt voor het minimum.
if ("intervals" in report_options.seriesDefaults.rendererOptions)
{
l_limits = report_options.seriesDefaults.rendererOptions.intervals;
delete report_options.seriesDefaults.rendererOptions.intervals; // Voorkom dat deze array de "effectiveprops" overschrijft.
} // De eeste waarde in het array wordt alleen gebruikt voor het minimum.
}
if (l_limits.length < 3)
l_limits = l_init.limiet;
@@ -317,7 +321,7 @@ function fac_usrrap_list_graph (model, scf_params)
var l_x = l_arr_x[0];
var l_y = l_arr_y[0];
var l_colors = <%=S("fac_graph_gauge_colors")%>;
var l_colors = <%=S("udr_graph_gauge_colors")%>;
var effectivedata = [ [100* l_x / l_y] ];
var props = { title: l_init.title
, seriesDefaults: { renderer: $.jqplot.MeterGaugeRenderer
@@ -341,7 +345,7 @@ function fac_usrrap_list_graph (model, scf_params)
break;
case 3: // pie-chart
%>
var l_colors = <%=S("fac_graph_pie_colors")%>;
var l_colors = <%=S("udr_graph_pie_colors")%>;
var effectivedata = [l_data.arr_xy];
var props = { title: l_init.title
, seriesColors: l_colors
@@ -370,7 +374,7 @@ function fac_usrrap_list_graph (model, scf_params)
{
l_labels.push(l_axes.yas[y].naam);
}
var l_colors = (l_yas_count == 1? <%=S("fac_graph_colors1")%> : <%=S("fac_graph_colors2")%>);
var l_colors = (l_yas_count == 1? <%=S("udr_graph_colors1")%> : <%=S("udr_graph_colors2")%>);
var effectivedata = l_arr_y;
var props = { seriesDefaults: { pointLabels: { show: true
}

View File

@@ -311,7 +311,7 @@ function fac_graph_generate (usrgraph_key, fclt_key, params)
{
case 1: // BarChart
%>
var l_colors = (l_yas_count == 1?<%=S("fac_graph_colors1")%> : <%=S("fac_graph_colors2")%>);
var l_colors = (l_yas_count == 1?<%=S("udr_graph_colors1")%> : <%=S("udr_graph_colors2")%>);
var props = { seriesDefaults:{ renderer: $.jqplot.BarRenderer
, pointLabels: { show: false }
}
@@ -383,7 +383,7 @@ function fac_graph_generate (usrgraph_key, fclt_key, params)
break;
case 3: // pie-chart
%>
var l_colors = <%=S("fac_graph_pie_colors")%>;
var l_colors = <%=S("udr_graph_pie_colors")%>;
var props = { title: l_init.title
, seriesColors: (l_userColors? l_userColors : l_colors)
, seriesDefaults: { renderer:$.jqplot.PieRenderer
@@ -415,7 +415,7 @@ function fac_graph_generate (usrgraph_key, fclt_key, params)
{
l_labels.push(l_axes.yas[y].naam);
}
var l_colors = (l_yas_count == 1? <%=S("fac_graph_colors1")%> : <%=S("fac_graph_colors2")%>);
var l_colors = (l_yas_count == 1? <%=S("udr_graph_colors1")%> : <%=S("udr_graph_colors2")%>);
var props = { seriesDefaults: { pointLabels: { show: true
}
}