|
|
|
@ -26,14 +26,14 @@ this.isDefault=isDefault;
@@ -26,14 +26,14 @@ this.isDefault=isDefault;
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function chartProperty(name,caption,isDynamic,isMeasure,isOptional,staticValues,defaultValue,optionalFunction)
|
|
|
|
|
function chartProperty(name,caption,isDynamic,isMeasure,isMandatory,staticValues,defaultValue,optionalFunction)
|
|
|
|
|
{ |
|
|
|
|
this.name=name; |
|
|
|
|
this.caption=caption; |
|
|
|
|
this.isDynamic=isDynamic; |
|
|
|
|
this.isMeasure=isMeasure; |
|
|
|
|
this.staticValues=staticValues; |
|
|
|
|
this.isOptional=isOptional; |
|
|
|
|
this.isMandatory=isMandatory; |
|
|
|
|
this.defaultValue=defaultValue; |
|
|
|
|
this.optionalFunction=optionalFunction; |
|
|
|
|
this.getValueResultset = function () { |
|
|
|
@ -83,8 +83,8 @@ function prepareChartProperties(chartType)
@@ -83,8 +83,8 @@ function prepareChartProperties(chartType)
|
|
|
|
|
case "bar_x": |
|
|
|
|
chartProperties=prepareBarXForm(); |
|
|
|
|
break; |
|
|
|
|
case "rect_y": |
|
|
|
|
chartProperties=prepareRectYForm(); |
|
|
|
|
case "bar_y": |
|
|
|
|
chartProperties=prepareBarYForm(); |
|
|
|
|
break; |
|
|
|
|
case "line": |
|
|
|
|
chartProperties=prepareLineForm(); |
|
|
|
@ -102,22 +102,24 @@ function prepareBarXForm()
@@ -102,22 +102,24 @@ function prepareBarXForm()
|
|
|
|
|
{ |
|
|
|
|
var chartProperties=[]; |
|
|
|
|
var propertyCounter=0; |
|
|
|
|
var myProp= new chartProperty("viz_category_dim","Kategorie-Dimension",true,false,false,null,null,true); |
|
|
|
|
var myProp= new chartProperty("viz_category_dim","Kategorie-Dimension",true,false,true,null,null,true); |
|
|
|
|
chartProperties[0]=myProp; |
|
|
|
|
var myProp= new chartProperty("viz_measure_dim","Maß",true,true,false,null,null,true); |
|
|
|
|
var myProp= new chartProperty("viz_measure_dim","Maß",true,true,false,true,null,true); |
|
|
|
|
chartProperties[1]=myProp; |
|
|
|
|
|
|
|
|
|
return chartProperties; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function prepareRectYForm() |
|
|
|
|
function prepareBarYForm() |
|
|
|
|
{ |
|
|
|
|
var chartProperties=[]; |
|
|
|
|
var propertyCounter=0; |
|
|
|
|
var myProp= new chartProperty("viz_category_dim","Kategorie-Dimension",true,false,false,null,null,true); |
|
|
|
|
var myProp= new chartProperty("viz_category_dim","Kategorie-Dimension",true,false,true,null,null,true); |
|
|
|
|
chartProperties[0]=myProp; |
|
|
|
|
var myProp= new chartProperty("viz_measure_dim","Maß",true,true,false,null,null,true); |
|
|
|
|
var myProp= new chartProperty("viz_series_dim","Serien-Dimension",true,false,false,null,null,true); |
|
|
|
|
chartProperties[1]=myProp; |
|
|
|
|
var myProp= new chartProperty("viz_measure_dim","Maß",true,true,true,null,null,true); |
|
|
|
|
chartProperties[2]=myProp; |
|
|
|
|
|
|
|
|
|
return chartProperties; |
|
|
|
|
} |
|
|
|
@ -126,9 +128,9 @@ function prepareLineForm()
@@ -126,9 +128,9 @@ function prepareLineForm()
|
|
|
|
|
{ |
|
|
|
|
var chartProperties=[]; |
|
|
|
|
var propertyCounter=0; |
|
|
|
|
var myProp= new chartProperty("viz_category_dim","X-Achse",true,false,false,null,null,true); |
|
|
|
|
var myProp= new chartProperty("viz_category_dim","X-Achse",true,false,true,null,null,true); |
|
|
|
|
chartProperties[0]=myProp; |
|
|
|
|
var myProp= new chartProperty("viz_measure_dim","Y-Achse",true,true,false,null,null,true); |
|
|
|
|
var myProp= new chartProperty("viz_measure_dim","Y-Achse",true,true,true,null,null,true); |
|
|
|
|
chartProperties[1]=myProp; |
|
|
|
|
|
|
|
|
|
return chartProperties; |
|
|
|
@ -154,7 +156,7 @@ function renderForm(formDiv,chartProperties,myCommonChartProperties,dimFunctions
@@ -154,7 +156,7 @@ function renderForm(formDiv,chartProperties,myCommonChartProperties,dimFunctions
|
|
|
|
|
const selElem = document.createElement("select"); |
|
|
|
|
selElem.name=chartProperties[k].name; |
|
|
|
|
selElem.id=chartProperties[k].name; |
|
|
|
|
fillSelectOptions(selElem,chartProperties[k].getValueResultset(),true); |
|
|
|
|
fillSelectOptions(selElem,chartProperties[k].getValueResultset(),chartProperties[k].isMandatory); |
|
|
|
|
tdSelElem.appendChild(selElem); |
|
|
|
|
if(chartProperties[k].optionalFunction) |
|
|
|
|
{ |
|
|
|
@ -340,8 +342,8 @@ switch (chartType)
@@ -340,8 +342,8 @@ switch (chartType)
|
|
|
|
|
case "bar_x": |
|
|
|
|
makeBarX(svg,data); |
|
|
|
|
break; |
|
|
|
|
case "rect_y": |
|
|
|
|
makeRectY(svg,data); |
|
|
|
|
case "bar_y": |
|
|
|
|
makeBarY(svg,data); |
|
|
|
|
break; |
|
|
|
|
|
|
|
|
|
case "line": |
|
|
|
@ -447,7 +449,7 @@ var options = {
@@ -447,7 +449,7 @@ var options = {
|
|
|
|
|
document.getElementById("chartDiv").appendChild(Plot.plot(options)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function makeRectY(svg,data) { |
|
|
|
|
function makeBarY(svg,data) { |
|
|
|
|
var xLabel=rsMetaData[document.getElementById("viz_category_dim").value-1].colcaption; |
|
|
|
|
var yLabel=rsMetaData[document.getElementById("viz_measure_dim").value-1].colcaption; |
|
|
|
|
var fontSize=getCommonChartProperty("fontSize"); |
|
|
|
@ -466,62 +468,24 @@ var options = {
@@ -466,62 +468,24 @@ var options = {
|
|
|
|
|
grid:true, |
|
|
|
|
label: yLabel
|
|
|
|
|
}, |
|
|
|
|
sort: "nr",
|
|
|
|
|
|
|
|
|
|
marks: [ |
|
|
|
|
Plot.barY(data,{ |
|
|
|
|
Plot.barY(data, |
|
|
|
|
Plot.groupX( |
|
|
|
|
{y: "sum"}, |
|
|
|
|
{ |
|
|
|
|
x: "name",
|
|
|
|
|
y: "value" |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
] |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
document.getElementById("chartDiv").appendChild(Plot.plot(options)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function makeBarY(svg,data) { |
|
|
|
|
var options = { |
|
|
|
|
marginBottom:100, |
|
|
|
|
x: { |
|
|
|
|
tickRotate: -45, |
|
|
|
|
ticks: 5, |
|
|
|
|
tickSize: 5, |
|
|
|
|
line: true, |
|
|
|
|
tickPadding: 10, |
|
|
|
|
labelAnchor: "left", |
|
|
|
|
labelOffset: 0, |
|
|
|
|
nice: true, |
|
|
|
|
label: "My label" |
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
// set y axis options
|
|
|
|
|
y: { |
|
|
|
|
grid:true |
|
|
|
|
}, |
|
|
|
|
sort: "nr", |
|
|
|
|
// define the marks we will use, dots and a line
|
|
|
|
|
marks: [ |
|
|
|
|
//Plot.barY(data, Plot.groupX({x: "name", y: "value" }))
|
|
|
|
|
Plot.barY( |
|
|
|
|
data, |
|
|
|
|
Plot.groupX( |
|
|
|
|
{ y: "sum" },
|
|
|
|
|
{
|
|
|
|
|
x: "name",
|
|
|
|
|
y: "value",
|
|
|
|
|
sort: {x:"nr"},
|
|
|
|
|
filter: null
|
|
|
|
|
} |
|
|
|
|
) |
|
|
|
|
) |
|
|
|
|
] |
|
|
|
|
//Plot.dot(data, {x: "nr", y: "value",sort: { x: "nr" } })
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
document.getElementById("chartDiv").appendChild(Plot.plot(options)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
function getCommonChartProperty(name) |
|
|
|
|
{ |
|
|
|
|