|
From: <j-...@us...> - 2012-09-28 16:42:05
|
Revision: 1022
http://openautomation.svn.sourceforge.net/openautomation/?rev=1022&view=rev
Author: j-n-k
Date: 2012-09-28 16:41:56 +0000 (Fri, 28 Sep 2012)
Log Message:
-----------
Plugin diagram, new feature: legendposition=("ne" | "nw" | "se" | "sw")
default if omitted: "ne" (editor-names: topright, topleft, bottomright, bottomleft)
fixed xsd (unit missing in axis-definition, added new options)
Modified Paths:
--------------
CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
CometVisu/trunk/visu/visu_config.xsd
Modified: CometVisu/trunk/visu/plugins/diagram/structure_plugin.js
===================================================================
--- CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2012-09-27 18:07:29 UTC (rev 1021)
+++ CometVisu/trunk/visu/plugins/diagram/structure_plugin.js 2012-09-28 16:41:56 UTC (rev 1022)
@@ -133,6 +133,7 @@
diagram.data("period", $p.attr("period") || 1);
diagram.data("datasource", $p.attr("datasource") || "AVERAGE");
diagram.data("legend", $p.attr("legend") || "both");
+ diagram.data("legendposition", $p.attr("legendposition") || "ne");
if ($p.attr("title")) {
diagram.data("label", $p.attr("title"));
} else {
@@ -280,7 +281,8 @@
height: {type: "string", required: false},
previewlabels: {type: "list", required: false, list: {'true': "yes", 'false': "no"}},
popup: {type: "list", required: false, list: {'true': "yes", 'false': "no"}},
- showlegend: {type: "list", required: false, list: {'both': "both", 'inline': "inline", 'popup': "popup", 'none': "none"}},
+ legend: {type: "list", required: false, list: {'both': "both", 'inline': "inline", 'popup': "popup", 'none': "none"}},
+ legendposition: {type: "list", rquired: false, list: {'se' : "bottomright", 'sw':"bottomleft", 'ne' : "topright", 'nw':"topleft"}},
title: {type: "string", required: false}
},
elements: {
@@ -344,6 +346,7 @@
bDiagram.data("period", $p.attr("period") || 1);
bDiagram.data("datasource", $p.attr("datasource") || "AVERAGE");
bDiagram.data("legend", $p.attr("legend") || "both");
+ bDiagram.data("legendposition", $p.attr("legendposition") || "ne");
if ($p.attr("title")) {
bDiagram.data("label", $p.attr("title"));
} else {
@@ -422,10 +425,11 @@
gridcolor: {type: "string", required: false},
yaxismin: {type: "numeric", required: false},
yaxismax: {type: "numeric", required: false},
- format: { type: 'format', required: false },
- mapping: { type: 'mapping', required: false },
- styling: { type: 'styling', required: false },
+ format: {type: 'format', required: false },
+ mapping: {type: 'mapping', required: false },
+ styling: {type: 'styling', required: false },
legend: {type: "list", required: false, list: {'both': "both", 'inline': "inline", 'popup': "popup", 'none': "none"}},
+ legendposition: {type: "list", rquired: false, list: {'se' : "bottomright", 'sw':"bottomleft", 'ne' : "topright", 'nw':"topleft"}},
title: {type: "string", required: false}
},
elements: {
@@ -462,7 +466,7 @@
var showlegend = !((diagram.data("legend")=="none")
|| (diagram.data("ispopup") && (diagram.data("legend")=="inline"))
|| (!diagram.data("ispopup") && (diagram.data("legend")=="popup")));
-
+ var legendposition = diagram.data("legendposition");
var label = diagram.data("label"); // title of diagram
var refresh = diagram.data("refresh");
var datasource = diagram.data("datasource") || "AVERAGE"; //FIXME: to be moved to rrd-definition
@@ -485,7 +489,8 @@
}],
legend: {
show: showlegend,
- backgroundColor: "#101010"
+ backgroundColor: "#101010",
+ position: legendposition
},
series: {
points: { show: false, fill: false }
Modified: CometVisu/trunk/visu/visu_config.xsd
===================================================================
--- CometVisu/trunk/visu/visu_config.xsd 2012-09-27 18:07:29 UTC (rev 1021)
+++ CometVisu/trunk/visu/visu_config.xsd 2012-09-28 16:41:56 UTC (rev 1022)
@@ -80,12 +80,22 @@
</xsd:restriction>
</xsd:simpleType>
+ <xsd:simpleType name="legendposition">
+ <xsd:restriction base="xsd:string">
+ <xsd:enumeration value="nw" />
+ <xsd:enumeration value="ne" />
+ <xsd:enumeration value="sw" />
+ <xsd:enumeration value="se" />
+ </xsd:restriction>
+ </xsd:simpleType>
+
<xsd:simpleType name="navbarPositionType">
<xsd:restriction base="xsd:string">
<xsd:enumeration value="top" />
<xsd:enumeration value="left" />
<xsd:enumeration value="right" />
<xsd:enumeration value="bottom" />
+ <xsd:attribute name="scope" type="xsd:decimal" use="optional" />
</xsd:restriction>
</xsd:simpleType>
@@ -324,7 +334,6 @@
<xsd:attribute name="position" type="navbarPositionType" use="required" />
<xsd:attribute name="dynamic" type="true_false" use="optional" />
<xsd:attribute name="width" type="xsd:string" use="optional" />
- <xsd:attribute name="scope" type="xsd:decimal" use="optional" />
</xsd:complexType>
<!-- more fun part - all widgets - if you add a new widget, you need to define it here -->
@@ -535,9 +544,11 @@
<xsd:attribute name="yaxismin" type="xsd:string" use="optional" />
<xsd:attribute name="yaxismax" type="xsd:string" use="optional" />
<xsd:attribute name="legend" type="xsd:string" use="optional" />
+ <xsd:attribute name="legendposition" type="legendposition" use="optional" />
<xsd:attribute name="popup" type="xsd:boolean" use="optional" />
<xsd:attribute name="previewlabels" type="xsd:boolean" use="optional" />
<xsd:attribute name="title" type="xsd:string" use="optional" />
+ <xsd:attribute name="tooltip" type="xsd:string" use="optional" />
</xsd:complexType>
<xsd:complexType name="diagram_inline">
@@ -606,6 +617,7 @@
<xsd:attribute name="yaxismin" type="xsd:string" use="optional" />
<xsd:attribute name="yaxismax" type="xsd:string" use="optional" />
<xsd:attribute name="legend" type="xsd:string" use="optional" />
+ <xsd:attribute name="legendposition" type="legendposition" use="optional" />
<xsd:attribute name="title" type="xsd:string" use="optional" />
</xsd:complexType>
@@ -693,6 +705,7 @@
<xsd:attribute name="min" type="xsd:decimal"></xsd:attribute>
<xsd:attribute name="max" type="xsd:decimal"></xsd:attribute>
<xsd:attribute name="position" type="xsd:string"></xsd:attribute>
+ <xsd:attribute name="unit" type="xsd:string" use="optional" />
</xsd:extension>
</xsd:simpleContent>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|