Contents
- Region
- Co-ordinate Units
- Alignment
Having trouble getting help?
Contact Support
Contact Support
Annotation in ASP.NET CORE Accumulation Chart Component
4 Jun 20246 minutes to read
The annotations are used to mark the specific area of interest in the chart area with texts, shapes or images.
By using the content
option of annotation property, you can specify the Id of the element that needs to be displayed in the chart area.
@{
List<PieChartData> chartData = new List<PieChartData>
{
new PieChartData { xValue = "Chrome", yValue = 37 },
new PieChartData { xValue = "UC Browser", yValue = 17 },
new PieChartData { xValue = "iPhone", yValue = 19 },
new PieChartData { xValue = "Others", yValue = 4 },
new PieChartData { xValue = "Opera", yValue = 11 },
new PieChartData { xValue = "Android", yValue = 12 },
};
}
<ejs-accumulationchart id="container" title="Mobile Browser Statistics">
<e-accumulationchart-legendsettings visible="false">
</e-accumulationchart-legendsettings>
<e-accumulation-series-collection>
<e-accumulation-series dataSource="chartData" xName="xValue" yName="yValue" name="Browser">
</e-accumulation-series>
</e-accumulation-series-collection>
<e-accumulationchart-accumulationannotations>
<e-accumulationchart-accumulationannotation Content="<div style='border: 1px solid black;background-color:red;padding: 5px 5px 5px 5px'>Others</div>" X="iPhone" Y=19 CoordinateUnits='@Syncfusion.EJ2.Charts.Units.Point' region='@Syncfusion.EJ2.Charts.Regions.Series'></e-accumulationchart-accumulationannotation>
</e-accumulationchart-accumulationannotations>
</ejs-accumulationchart>
...
public class PieChartData
{
public string xValue;
public double yValue;
}
Region
The annotation can be placed with respect to either Series
or Chart
.
@{
List<PieChartData> chartData = new List<PieChartData>
{
new PieChartData { x = "Chrome", y = 37 },
new PieChartData { x = "UC Browser", y = 17 },
new PieChartData { x = "iPhone", y = 19 },
new PieChartData { x = "Others", y = 4 },
new PieChartData { x = "Opera", y = 11 },
new PieChartData { x = "Android", y = 12 },
};
}
<ejs-accumulationchart id="container" title="Mobile Browser Statistics">
<e-accumulationchart-legendsettings visible="false">
</e-accumulationchart-legendsettings>
<e-accumulation-series-collection>
<e-accumulation-series dataSource="chartData" xName="x" yName="y" name="Browser">
</e-accumulation-series>
</e-accumulation-series-collection>
<e-accumulationchart-accumulationannotations>
<e-accumulationchart-accumulationannotation Content="<div style='border: 1px solid black;background-color:red;padding: 5px 5px 5px 5px'>Others</div>" X="iPhone" Y=19 CoordinateUnits='@Syncfusion.EJ2.Charts.Units.Pixel' region='@Syncfusion.EJ2.Charts.Regions.Chart'></e-accumulationchart-accumulationannotation>
</e-accumulationchart-accumulationannotations>
</ejs-accumulationchart>
...
public class PieChartData
{
public string x;
public double y;
}
Co-ordinate Units
Specifies the coordinate units of an annotation either in Pixel
or Point
.
@{
List<PieChartData> chartData = new List<PieChartData>
{
new PieChartData { x = "Chrome", y = 37 },
new PieChartData { x = "UC Browser", y = 17 },
new PieChartData { x = "iPhone", y = 19 },
new PieChartData { x = "Others", y = 4 },
new PieChartData { x = "Opera", y = 11 },
new PieChartData { x = "Android", y = 12 },
};
}
<ejs-accumulationchart id="container" title="Mobile Browser Statistics">
<e-accumulationchart-legendsettings visible="false">
</e-accumulationchart-legendsettings>
<e-accumulation-series-collection>
<e-accumulation-series dataSource="chartData" xName="x" yName="y" name="Browser">
</e-accumulation-series>
</e-accumulation-series-collection>
<e-accumulationchart-accumulationannotations>
<e-accumulationchart-accumulationannotation Content="<div style='border: 1px solid black;background-color:red;padding: 5px 5px 5px 5px'>Others</div>" X="iPhone" Y=19 CoordinateUnits='@Syncfusion.EJ2.Charts.Units.Pixel' region='@Syncfusion.EJ2.Charts.Regions.Chart'></e-accumulationchart-accumulationannotation>
</e-accumulationchart-accumulationannotations>
</ejs-accumulationchart>
...
public class PieChartData
{
public string x;
public double y;
}
Alignment
The annotations can be moved vertically and horizontally from its default position by using verticalAlignment
or horizontalAlignment
properties. The verticalAlignment property takes value as Top
, Bottom
or Middle
and the horizontalAlignment property takes value as Near
, Far
or Center
.
@{
List<PieChartData> chartData = new List<PieChartData>
{
new PieChartData { x = "Chrome", y = 37 },
new PieChartData { x = "UC Browser", y = 17 },
new PieChartData { x = "iPhone", y = 19 },
new PieChartData { x = "Others", y = 4 },
new PieChartData { x = "Opera", y = 11 },
new PieChartData { x = "Android", y = 12 },
};
}
<ejs-accumulationchart id="container" title="Mobile Browser Statistics">
<e-accumulationchart-legendsettings visible="false">
</e-accumulationchart-legendsettings>
<e-accumulation-series-collection>
<e-accumulation-series dataSource="chartData" xName="x" yName="y" name="Browser">
</e-accumulation-series>
</e-accumulation-series-collection>
<e-accumulationchart-accumulationannotations>
<e-accumulationchart-accumulationannotation Content="<div style='border: 1px solid black;background-color:red;padding: 5px 5px 5px 5px'>Others</div>" X="iPhone" Y=19 CoordinateUnits='@Syncfusion.EJ2.Charts.Units.Pixel' region='@Syncfusion.EJ2.Charts.Regions.Chart' verticalAlignment="Top" horizontalAlignment="Near"></e-accumulationchart-accumulationannotation>
</e-accumulationchart-accumulationannotations>
</ejs-accumulationchart>
...
public class PieChartData
{
public string x;
public double y;
}