Thread ID: |
Created: |
Updated: |
Platform: |
Replies: |
144259 | Apr 26,2019 11:06 PM UTC | Apr 30,2019 05:49 PM UTC | Angular - EJ 2 | 3 |
![]() |
Tags: Chart |
<ejs-chart style='display:block;' align='center' id='chartcontainer' [margin]='margin'
[primaryXAxis]='primaryXAxis'>
<e-annotations>
<e-annotation content="<div>Jan</div>" x=20 y=350 coordinateUnits='Pixel'></e-annotation>
<e-annotation content="<div>Feb</div>" x=20 y=250 coordinateUnits='Pixel'></e-annotation>
<e-annotation content="<div>Mar</div>" x=20 y=150 coordinateUnits='Pixel'></e-annotation>
<e-annotation content="<div>Apr</div>" x=20 y=50 coordinateUnits='Pixel'></e-annotation>
</e-annotations>
</ejs-chart>
public primaryXAxis: Object = {
valueType: 'Category',
labelStyle: {
size: '0px' // disable the axis labels
},
};
public margin: Object = {
left: 60
}; |
ejs-chart (annotationRender)='annotationRender($event)' (load)='load($event)'>
<e-annotations>
<e-annotation content="<div>Jan</div>" x='xx' y=-10 coordinateUnits='Point'></e-annotation>
<e-annotation content="<div>Feb</div>" x='xx' y=-10 coordinateUnits='Point'></e-annotation>
<e-annotation content="<div>Mar</div>" x='xx' y=-10 coordinateUnits='Point'></e-annotation>
<e-annotation content="<div>Apr</div>" x='xx' y=-10 coordinateUnits='Point'></e-annotation>
</e-annotations>
</ejs-chart>
public load(args) {
let dataSource = args.chart.series[0].dataSource;
for (let i: number = 0; i < dataSource.length; i++) {
args.chart.annotations[i].x = dataSource[i].x;
}
}
public annotationRender(args) {
args.location.x -= 50;
}
|
This post will be permanently deleted. Are you sure you want to continue?
Sorry, An error occured while processing your request. Please try again later.
This page will automatically be redirected to the sign-in page in 10 seconds.