-
Notifications
You must be signed in to change notification settings - Fork 0
Labels
An InteractiveDataDisplay plot which dispays text labels.
<script type="text/javascript">
$(document).ready(function () {
var chart = InteractiveDataDisplay.asPlot($("#chart"));
});
</script>
<div id="chart" data-idd-plot="chart" style="width: 800px; height: 600px;">
</div>
In JavaScript, use InteractiveDataDisplay.Plot.labels(name, data)
or
InteractiveDataDisplay.LabelPlot.draw(data)
.
The Plot.labels
function returns LabelPlot
which allows to update values using LabelPlot.draw
function.
The following example adds "LabelPlot"
with three labels to the chart
.
var chart = InteractiveDataDisplay.asPlot($("#chart"));
var labels = chart.labels("labels", [
{ text: "label1", position: {x: 0, y: 0}},
{ text: "label2", position: {x: 1.5, y: -1}, placement: 'center'},
{ text: "label3", position: {x: 3, y: 0}, placement: 'bottom'}
]);
LabelPlot
contains the method LabelPlot.getData()
, which returns an array of labels in LabelPlot
.
To update labels in LabelPlot
use LabelPlot.draw
function.
The following example adds a new label to LabelPlot
.
var chart = InteractiveDataDisplay.asPlot($("#chart"));
var labels = chart.labels("labels", [
{ text: "label1", position: {x: 0, y: 0}},
{ text: "label2", position: {x: 1.5, y: -1}, placement: 'center'}
]);
//add new label
var data = labels.getData();
data.push({text: "label4", position: {x: 5, y: 6}});
labels.draw(data);
Mandatory properties:
-
text
contains the text of the label. -
position
is a structure containing two fields:x
andy
.x
andy
are numbers.
Optional properties:
-
placement
is either'center'
,'top'
,'bottom'
,'left'
,'right'
; default value is'center'
.
Home
FAQ
UI Guidelines
Export to SVG
Plot
Figure
Chart
ChartViewer
Polyline
Markers
Area
Heatmap
DOM Plot
Labels
Bing Maps
Intro
General bindings
Area plot
Bars plot
Polyline
Heatmap
Markers
Label plot
Box and whisker plot
Petals and BullEye plot
Axis
Palette Editor
Update layout
Axes
Legend
Color Palette
Navigation
Bound Plots
Tooltips and Probes