Annotations

The sample shows basic usage of AnnotationLayer and various built-in types of Annotations, including: Circle, Ellipse, Image, Line, Polygon, Rectangle, Square and Text.

You can use attachment property to set different attach types of annotation.

import 'bootstrap.css'; import '@grapecity/wijmo.styles/wijmo.css'; import './styles.css'; import * as wjChart from '@grapecity/wijmo.chart'; import * as wjAnnotation from '@grapecity/wijmo.chart.annotation'; import { getData, getAnnotation } from './data'; // document.readyState === 'complete' ? init() : window.onload = init; // function init() { // create the chart let theChart = new wjChart.FlexChart('#theChart', { bindingX: 'date', chartType: 'Line', itemsSource: getData(), series: [ { name: 'Sale', binding: 'sale' } ] }); var basicAL = new wjAnnotation.AnnotationLayer(theChart, getAnnotation()); } <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>GrapeCity Wijmo FlexChart Annotations</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- SystemJS --> <script src="node_modules/systemjs/dist/system.src.js"></script> <script src="systemjs.config.js"></script> <script> System.import('./src/app'); </script> </head> <body> <div class="container-fluid"> <div id="theChart"></div> </div> </body> </html> import * as core from '@grapecity/wijmo'; export function getAnnotation() { let data = [ { "type": "Circle", "radius": 40, "offset": { "x": 0, "y": -15 }, "seriesIndex": 0, "pointIndex": 33, "content": "DataIndex", "position": 0, "attachment": 0, "tooltip": "This is a circle annotation. </br> radius: 40 </br> pointIndex: 33 </br> attachment: DataIndex", "style": { "fill": "#a3d1a7", "stroke": "#7b9e7e", "fill-opacity": 1, "stroke-width": 2, "stroke-opacity": 1 } }, { "type": "Square", "length": 80, "offset": { "x": 0, "y": -15 }, "seriesIndex": 0, "pointIndex": 45, "content": "DataIndex", "position": 0, "attachment": 0, "tooltip": "This is a square annotation. </br>length: 80 </br> pointIndex: 45 </br> attachment: DataIndex", "style": { "fill": "#c4af71", "stroke": "#918254", "fill-opacity": 1, "stroke-width": 2, "stroke-opacity": 1 } }, { "type": "Line", "content": "Absolute", "position": 0, "start": { "x": 50, "y": 150 }, "end": { "x": 350, "y": 300 }, "tooltip": "This is a line annotation. </br> start: { x: 50, y: 150 } end: { x: 350, y: 300 } </br> attachment: Absolute", "style": { "fill": "#FE2E2E", "stroke": "#01A9DB", "fill-opacity": 2, "stroke-width": 4, "stroke-opacity": 1 } }, { "type": "Text", "attachment": 2, "text": "Relative", "position": 0, "point": { "x": 0.55, "y": 0.15 }, "tooltip": "This is a text annotation.</br>point: { x: 0.55, y: 0.15 }</br> attachment: Relative", "style": { "fill": "#bbbbbb", "font-size": "26px" } }, { "type": "Ellipse", "content": "Relative", "position": 0, "attachment": 2, "length": 80, "point": { "x": 0.4, "y": 0.5 }, "seriesIndex": 0, "pointIndex": 45, "tooltip": "This is an ellipse annotation.</br>point: { x: 0.4, y: 0.45 }</br> attachment: Relative", "style": { "fill": "#f5bc78", "stroke": "#c2955f", "fill-opacity": 1, "stroke-width": 2, "stroke-opacity": 1 } }, { "type": "Rectangle", "content": "DataCoordinate", "position": 0, "attachment": 1, "point": { "x": "2014-02-10", "y": 30 }, "tooltip": "This is a rectangle annotation.</br>point:{ x: new Date(2014, 1, 10), y: 40 }</br> attachment: DataCoordinate", "seriesIndex": 0, "pointIndex": 45, "style": { "fill": "#c5aacd", "stroke": "#937f99", "fill-opacity": 1, "stroke-width": 2, "stroke-opacity": 1 } }, { "type": "Image", "position": 0, "attachment": 1, "href": "resources/wijmo5-flexible.png", "point": { "x": "2014-01-25", "y": 30 }, "tooltip": "This is an image annotation.</br>point:{x: new Date(2014, 0, 25), y: 20}</br> attachment: DataCoordinate", "style": { "fill": "#01DFD7", "stroke": "#000000", "fill-opacity": 1, "stroke-width": 1, "stroke-opacity": 1 } }, { "type": "Polygon", "content": "Absolute", "position": 0, "tooltip": "This is a polygon annotation.</br>points: [(200,0),(150,50),(175,100),(255,100),(250, 50)]</br> attachment: Absolute", "style": { "fill": "#FE2E2E", "stroke": "#01A9DB", "fill-opacity": 2, "stroke-width": 4, "stroke-opacity": 1 }, "points": [ { "x": 200, "y": 0 }, { "x": 150, "y": 50 }, { "x": 175, "y": 100 }, { "x": 225, "y": 100 }, { "x": 250, "y": 50 } ] } ]; for (var i = 0; i < data.length; i++) { if (data[i].attachment === 1 && data[i].point && data[i].point.x && isNaN(data[i].point.x)) { data[i].point.x = core.Globalize.parseDate(data[i].point.x, 'yyyy-MM-dd'); } } return data; } // export function getData() { var data = [], sales = [ 96, 19, 54, 83, 15, 56, 36, 4, 29, 93, 38, 71, 50, 77, 69, 13, 79, 57, 29, 62, 4, 27, 66, 96, 65, 12, 52, 3, 61, 48, 50, 70, 39, 33, 25, 49, 69, 46, 44, 40, 35, 72, 64, 10, 66, 63, 78, 19, 96, 26 ]; for (var i = 0; i < 50; i++) { data.push({ sale: sales[i], date: new Date(2014, 0, i), }); } return data; } .wj-flexchart { margin: 10px 0; } body { margin-bottom: 24pt; } import 'bootstrap.css'; import '@grapecity/wijmo.styles/wijmo.css'; import './styles.css'; // import { Component, Inject, enableProdMode, NgModule } from '@angular/core'; import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { BrowserModule } from '@angular/platform-browser'; import { WjChartModule } from '@grapecity/wijmo.angular2.chart'; import { WjChartAnnotationModule } from '@grapecity/wijmo.angular2.chart.annotation'; import { DataService } from './app.data'; // @Component({ selector: 'app-component', templateUrl: 'src/app.component.html' }) export class AppComponent { data: any[]; basic: any; // constructor(@Inject(DataService) private dataService: DataService) { this.data = dataService.getData(); this.basic = { rectDate: new Date(2014, 1, 10), imageDate: new Date(2014, 0, 25) }; } } // @NgModule({ imports: [WjChartModule, WjChartAnnotationModule, BrowserModule], declarations: [AppComponent], providers: [DataService], bootstrap: [AppComponent] }) export class AppModule { } // enableProdMode(); // Bootstrap application with hash style navigation and global services. platformBrowserDynamic().bootstrapModule(AppModule); <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>GrapeCity Wijmo FlexChart Annotations</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- Polyfills --> <script src="node_modules/core-js/client/shim.min.js"></script> <script src="node_modules/zone.js/dist/zone.min.js"></script> <!-- SystemJS --> <script src="node_modules/systemjs/dist/system.js"></script> <script src="systemjs.config.js"></script> <script> // workaround to load 'rxjs/operators' from the rxjs bundle System.import('rxjs').then(function (m) { System.set(SystemJS.resolveSync('rxjs/operators'), System.newModule(m.operators)); System.import('./src/app.component'); }); </script> </head> <body> <app-component></app-component> </body> </html> <div class="container-fluid"> <div class="form-group"> <wj-flex-chart [itemsSource]="data" chartType="Line" bindingX="date"> <wj-flex-chart-series binding="sale"></wj-flex-chart-series> <wj-flex-chart-legend position="Left"></wj-flex-chart-legend> <wj-flex-chart-annotation-layer control="al"> <wj-flex-chart-annotation-circle [radius]="40" [offset]="{x: 0, y: -15}" [seriesIndex]="0" [pointIndex]="33" content="DataIndex" position="Center" attachment="DataIndex" tooltip="This is Circle annotation. &lt;/br&gt; radius: 40 &lt;/br&gt; pointIndex: 33 &lt;/br&gt; attachment: DataIndex" [style]="{ 'fill': '#a3d1a7', 'stroke': '#7b9e7e', 'fill-opacity': 1, 'stroke-width': 2, 'stroke-opacity': 1 }"></wj-flex-chart-annotation-circle> <wj-flex-chart-annotation-square [length]="80" [offset]="{x: 0, y: -15}" [seriesIndex]="0" [pointIndex]="45" content="DataIndex" position="Center" attachment="DataIndex" tooltip="This is square annotation. &lt;/br&gt;length: 80 &lt;/br&gt; pointIndex: 45 &lt;/br&gt; attachment: DataIndex" [style]="{ 'fill': '#c4af71', 'stroke': '#918254', 'fill-opacity': 1, 'stroke-width': 2, 'stroke-opacity': 1 }"></wj-flex-chart-annotation-square> <wj-flex-chart-annotation-line content="Absolute" position="Center" [start]="{x: 50, y: 150}" [end]="{x: 350, y: 300}" tooltip="This is line annotation. &lt;/br&gt; start: { x: 50, y: 150 } end: { x: 350, y: 300 } &lt;/br&gt; attachment: Absolute" [style]="{ 'fill': '#FE2E2E', 'stroke': '#01A9DB', 'fill-opacity': 2, 'stroke-width': 4, 'stroke-opacity': 1 }"></wj-flex-chart-annotation-line> <wj-flex-chart-annotation-text attachment="Relative" text="Relative" position="Center" [point]="{x:0.55, y:0.15}" tooltip="This is text annotation.&lt;/br&gt;point: { x: 0.55, y: 0.15 }&lt;/br&gt; attachment: Relative" [style]="{ 'fill': '#bbbbbb', 'font-size': '26px' }"></wj-flex-chart-annotation-text> <wj-flex-chart-annotation-ellipse content="Relative" position="Center" attachment="Relative" [point]="{x:0.4,y:0.5}" tooltip="This is ellipse annotation.&lt;/br&gt;point: { x: 0.4, y: 0.45 }&lt;/br&gt; attachment: Relative" [style]="{ 'fill': '#f5bc78', 'stroke': '#c2955f', 'fill-opacity': 1, 'stroke-width': 2, 'stroke-opacity': 1 }"></wj-flex-chart-annotation-ellipse> <wj-flex-chart-annotation-rectangle content="DataCoordinate" position="Center" attachment="DataCoordinate" [point]="{x: basic.rectDate, y: 30}" tooltip="This is rectangle annotation.&lt;/br&gt;point:{ x: new Date(2014, 1, 10), y: 40 }&lt;/br&gt; attachment: DataCoordinate" [style]="{ 'fill': '#c5aacd', 'stroke': '#937f99', 'fill-opacity': 1, 'stroke-width': 2, 'stroke-opacity': 1 }"></wj-flex-chart-annotation-rectangle> <wj-flex-chart-annotation-image position="Center" attachment="DataCoordinate" href="resources/wijmo5-flexible.png" [point]="{x: basic.imageDate, y: 30}" tooltip="This is image annotation.&lt;/br&gt;point:{x: new Date(2014, 0, 25), y: 20}&lt;/br&gt; attachment: DataCoordinate" [style]="{ 'fill': '#01DFD7', 'stroke': '#000000', 'fill-opacity': 1, 'stroke-width': 1, 'stroke-opacity': 1}"></wj-flex-chart-annotation-image> <wj-flex-chart-annotation-polygon content="Absolute" position="Center" tooltip="This is polygon annotation.&lt;/br&gt;paths: [(200,0),(150,50),(175,100),(255,100),(250, 50)]&lt;/br&gt; attachment: Absolute" [style]="{ 'fill': '#FE2E2E', 'stroke': '#01A9DB', 'fill-opacity': 2, 'stroke-width': 4, 'stroke-opacity': 1 }"> <wj-flex-chart-data-point wjProperty="points" [x]="200" [y]="0"></wj-flex-chart-data-point> <wj-flex-chart-data-point wjProperty="points" [x]="150" [y]="50"></wj-flex-chart-data-point> <wj-flex-chart-data-point wjProperty="points" [x]="175" [y]="100"></wj-flex-chart-data-point> <wj-flex-chart-data-point wjProperty="points" [x]="225" [y]="100"></wj-flex-chart-data-point> <wj-flex-chart-data-point wjProperty="points" [x]="250" [y]="50"></wj-flex-chart-data-point> </wj-flex-chart-annotation-polygon> </wj-flex-chart-annotation-layer> </wj-flex-chart> </div> </div> import { Injectable } from '@angular/core'; import * as core from '@grapecity/wijmo'; // @Injectable() export class DataService { getData() { var data = [], sales = [ 96, 19, 54, 83, 15, 56, 36, 4, 29, 93, 38, 71, 50, 77, 69, 13, 79, 57, 29, 62, 4, 27, 66, 96, 65, 12, 52, 3, 61, 48, 50, 70, 39, 33, 25, 49, 69, 46, 44, 40, 35, 72, 64, 10, 66, 63, 78, 19, 96, 26]; for (var i = 0; i < 50; i++) { data.push({ sale: sales[i], date: new Date(2014, 0, i), }); } return data; } } .wj-flexchart { margin: 10px 0; } body { margin-bottom: 24pt; } <template> <div class="container-fluid"> <div class="form-group"> <wj-flex-chart :itemsSource="data" chartType="Line" bindingX="date"> <wj-flex-chart-series binding="sale"></wj-flex-chart-series> <wj-flex-chart-legend position="Left"></wj-flex-chart-legend> <wj-flex-chart-annotation-layer control="al"> <wj-flex-chart-annotation-circle :radius=40 :offset="{x: 0, y: -15}" :seriesIndex=0 :pointIndex=33 content="DataIndex" position="Center" attachment="DataIndex" tooltip="This is Circle annotation. &lt;/br&gt; radius: 40 &lt;/br&gt; pointIndex: 33 &lt;/br&gt; attachment: DataIndex" :style="{ 'fill': '#a3d1a7', 'stroke': '#7b9e7e', 'fill-opacity': 1, 'stroke-width': 2, 'stroke-opacity': 1 }"></wj-flex-chart-annotation-circle> <wj-flex-chart-annotation-square :length=80 :offset="{x: 0, y: -15}" :seriesIndex=0 :pointIndex=45 content="DataIndex" position="Center" attachment="DataIndex" tooltip="This is square annotation. &lt;/br&gt;length: 80 &lt;/br&gt; pointIndex: 45 &lt;/br&gt; attachment: DataIndex" :style="{ 'fill': '#c4af71', 'stroke': '#918254', 'fill-opacity': 1, 'stroke-width': 2, 'stroke-opacity': 1 }"></wj-flex-chart-annotation-square> <wj-flex-chart-annotation-line content="Absolute" position="Center" :start="{x: 50, y: 150}" :end="{x: 350, y: 300}" tooltip="This is line annotation. &lt;/br&gt; start: { x: 50, y: 150 } end: { x: 350, y: 300 } &lt;/br&gt; attachment: Absolute" :style="{ 'fill': '#FE2E2E', 'stroke': '#01A9DB', 'fill-opacity': 2, 'stroke-width': 4, 'stroke-opacity': 1 }"></wj-flex-chart-annotation-line> <wj-flex-chart-annotation-text attachment="Relative" text="Relative" position="Center" :point="{x:0.55, y:0.15}" tooltip="This is text annotation.&lt;/br&gt;point: { x: 0.55, y: 0.15 }&lt;/br&gt; attachment: Relative" :style="{ 'fill': '#bbbbbb', 'font-size': '26px' }"></wj-flex-chart-annotation-text> <wj-flex-chart-annotation-ellipse content="Relative" position="Center" attachment="Relative" :point="{x:0.4,y:0.5}" tooltip="This is ellipse annotation.&lt;/br&gt;point: { x: 0.4, y: 0.45 }&lt;/br&gt; attachment: Relative" :style="{ 'fill': '#f5bc78', 'stroke': '#c2955f', 'fill-opacity': 1, 'stroke-width': 2, 'stroke-opacity': 1 }"></wj-flex-chart-annotation-ellipse> <wj-flex-chart-annotation-rectangle content="DataCoordinate" position="Center" attachment="DataCoordinate" :point="{x: basic.rectDate, y: 30}" tooltip="This is rectangle annotation.&lt;/br&gt;point:{ x: new Date(2014, 1, 10), y: 40 }&lt;/br&gt; attachment: DataCoordinate" :style="{ 'fill': '#c5aacd', 'stroke': '#937f99', 'fill-opacity': 1, 'stroke-width': 2, 'stroke-opacity': 1 }"></wj-flex-chart-annotation-rectangle> <wj-flex-chart-annotation-image position="Center" attachment="DataCoordinate" href="resources/wijmo5-flexible.png" :point="{x: basic.imageDate, y: 30}" tooltip="This is image annotation.&lt;/br&gt;point:{x: new Date(2014, 0, 25), y: 20}&lt;/br&gt; attachment: DataCoordinate" :style="{ 'fill': '#01DFD7', 'stroke': '#000000', 'fill-opacity': 1, 'stroke-width': 1, 'stroke-opacity': 1}"></wj-flex-chart-annotation-image> <wj-flex-chart-annotation-polygon content="Absolute" position="Center" tooltip="This is polygon annotation.&lt;/br&gt;paths: (200,0),(150,50),(175,100),(255,100),(250, 50)&lt;/br&gt; attachment: Absolute" :style="{ 'fill': '#FE2E2E', 'stroke': '#01A9DB', 'fill-opacity': 2, 'stroke-width': 4, 'stroke-opacity': 1 }"> <wj-flex-chart-data-point wjProperty="points" :x="200" :y="0"></wj-flex-chart-data-point> <wj-flex-chart-data-point wjProperty="points" :x="150" :y="50"></wj-flex-chart-data-point> <wj-flex-chart-data-point wjProperty="points" :x="175" :y="100"></wj-flex-chart-data-point> <wj-flex-chart-data-point wjProperty="points" :x="225" :y="100"></wj-flex-chart-data-point> <wj-flex-chart-data-point wjProperty="points" :x="250" :y="50"></wj-flex-chart-data-point> </wj-flex-chart-annotation-polygon> </wj-flex-chart-annotation-layer> </wj-flex-chart> </div> </div> </template> <script> import 'bootstrap.css'; import '@grapecity/wijmo.styles/wijmo.css'; import Vue from "vue"; import '@grapecity/wijmo.vue2.chart'; import '@grapecity/wijmo.vue2.chart.annotation'; import { getData } from './data'; import * as wjChart from '@grapecity/wijmo.chart'; var chartAnimation= null; new Vue({ el: "#app", data: { data: getData(), basic: { rectDate: new Date(2014, 1, 10), imageDate: new Date(2014, 0, 25) } } }); </script> <style> .container .wj-flexchart { margin: 10px 0; } body { margin-bottom: 24pt; } </style> <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>GrapeCity Wijmo FlexChart Annotations</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- SystemJS --> <script src="node_modules/systemjs/dist/system.src.js"></script> <script src="systemjs.config.js"></script> <script> System.import('./src/app.vue'); </script> </head> <body> <div id="app"> </div> </body> </html> import * as core from '@grapecity/wijmo'; export function getData() { var data = [], sales = [ 96, 19, 54, 83, 15, 56, 36, 4, 29, 93, 38, 71, 50, 77, 69, 13, 79, 57, 29, 62, 4, 27, 66, 96, 65, 12, 52, 3, 61, 48, 50, 70, 39, 33, 25, 49, 69, 46, 44, 40, 35, 72, 64, 10, 66, 63, 78, 19, 96, 26]; for (var i = 0; i < 50; i++) { data.push({ sale: sales[i], date: new Date(2014, 0, i), }); } return data; } import 'bootstrap.css'; import '@grapecity/wijmo.styles/wijmo.css'; import './app.css'; // import * as React from 'react'; import * as ReactDOM from 'react-dom'; // import * as Chart from '@grapecity/wijmo.react.chart'; import * as wjAnnotation from '@grapecity/wijmo.chart.annotation'; import { getData, getAnnotation } from './data'; // class App extends React.Component { constructor(props) { super(props); this.state = { data: getData() }; } render() { return <div className="container"> <div className="form-group"> <Chart.FlexChart initialized={this.initializeFlexGrid.bind(this)} itemsSource={this.state.data} chartType="Line" bindingX="date"> <Chart.FlexChartSeries binding="sale"></Chart.FlexChartSeries> <Chart.FlexChartLegend position="Left"></Chart.FlexChartLegend> </Chart.FlexChart> </div> </div>; } initializeFlexGrid(flexChart) { this.flexChart = flexChart; this.annotationLayer = new wjAnnotation.AnnotationLayer(flexChart, getAnnotation()); } } ReactDOM.render(<App />, document.getElementById('app')); <!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>GrapeCity Wijmo FlexChart Annotations</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <!-- SystemJS --> <script src="node_modules/systemjs/dist/system.src.js"></script> <script src="systemjs.config.js"></script> <script> System.import('./src/app'); </script> </head> <body> <div id="app"></div> </body> </html> .container .wj-flexchart { margin: 10px 0; } body { margin-bottom: 24pt; } import * as core from '@grapecity/wijmo'; export function getData() { var data = [], sales = [ 96, 19, 54, 83, 15, 56, 36, 4, 29, 93, 38, 71, 50, 77, 69, 13, 79, 57, 29, 62, 4, 27, 66, 96, 65, 12, 52, 3, 61, 48, 50, 70, 39, 33, 25, 49, 69, 46, 44, 40, 35, 72, 64, 10, 66, 63, 78, 19, 96, 26 ]; for (var i = 0; i < 50; i++) { data.push({ sale: sales[i], date: new Date(2014, 0, i), }); } return data; } export function getAnnotation() { let data = [ { "type": "Circle", "radius": 40, "offset": { "x": 0, "y": -15 }, "seriesIndex": 0, "pointIndex": 33, "content": "DataIndex", "position": 0, "attachment": 0, "tooltip": "This is a circle annotation. </br> radius: 40 </br> pointIndex: 33 </br> attachment: DataIndex", "style": { "fill": "#a3d1a7", "stroke": "#7b9e7e", "fill-opacity": 1, "stroke-width": 2, "stroke-opacity": 1 } }, { "type": "Square", "length": 80, "offset": { "x": 0, "y": -15 }, "seriesIndex": 0, "pointIndex": 45, "content": "DataIndex", "position": 0, "attachment": 0, "tooltip": "This is a square annotation. </br>length: 80 </br> pointIndex: 45 </br> attachment: DataIndex", "style": { "fill": "#c4af71", "stroke": "#918254", "fill-opacity": 1, "stroke-width": 2, "stroke-opacity": 1 } }, { "type": "Line", "content": "Absolute", "position": 0, "start": { "x": 50, "y": 150 }, "end": { "x": 350, "y": 300 }, "tooltip": "This is a line annotation. </br> start: { x: 50, y: 150 } end: { x: 350, y: 300 } </br> attachment: Absolute", "style": { "fill": "#FE2E2E", "stroke": "#01A9DB", "fill-opacity": 2, "stroke-width": 4, "stroke-opacity": 1 } }, { "type": "Text", "attachment": 2, "text": "Relative", "position": 0, "point": { "x": 0.55, "y": 0.15 }, "tooltip": "This is a text annotation.</br>point: { x: 0.55, y: 0.15 }</br> attachment: Relative", "style": { "fill": "#bbbbbb", "font-size": "26px" } }, { "type": "Ellipse", "content": "Relative", "position": 0, "attachment": 2, "length": 80, "point": { "x": 0.4, "y": 0.5 }, "seriesIndex": 0, "pointIndex": 45, "tooltip": "This is an ellipse annotation.</br>point: { x: 0.4, y: 0.45 }</br> attachment: Relative", "style": { "fill": "#f5bc78", "stroke": "#c2955f", "fill-opacity": 1, "stroke-width": 2, "stroke-opacity": 1 } }, { "type": "Rectangle", "content": "DataCoordinate", "position": 0, "attachment": 1, "point": { "x": "2014-02-10", "y": 30 }, "tooltip": "This is a rectangle annotation.</br>point:{ x: new Date(2014, 1, 10), y: 40 }</br> attachment: DataCoordinate", "seriesIndex": 0, "pointIndex": 45, "style": { "fill": "#c5aacd", "stroke": "#937f99", "fill-opacity": 1, "stroke-width": 2, "stroke-opacity": 1 } }, { "type": "Image", "position": 0, "attachment": 1, "href": "resources/wijmo5-flexible.png", "point": { "x": "2014-01-25", "y": 30 }, "tooltip": "This is an image annotation.</br>point:{x: new Date(2014, 0, 25), y: 20}</br> attachment: DataCoordinate", "style": { "fill": "#01DFD7", "stroke": "#000000", "fill-opacity": 1, "stroke-width": 1, "stroke-opacity": 1 } }, { "type": "Polygon", "content": "Absolute", "position": 0, "tooltip": "This is a polygon annotation.</br>points: [(200,0),(150,50),(175,100),(255,100),(250, 50)]</br> attachment: Absolute", "style": { "fill": "#FE2E2E", "stroke": "#01A9DB", "fill-opacity": 2, "stroke-width": 4, "stroke-opacity": 1 }, "points": [ { "x": 200, "y": 0 }, { "x": 150, "y": 50 }, { "x": 175, "y": 100 }, { "x": 225, "y": 100 }, { "x": 250, "y": 50 } ] } ]; for (var i = 0; i < data.length; i++) { var d = data[i]; if (d.attachment === 1 && d.point && d.point.x && isNaN(d.point.x)) { (d.point).x = core.Globalize.parseDate(d.point.x, 'yyyy-MM-dd'); } } return data; }