Hello ,
I am trying to make single column stack chart with 4 different column . Like At bottom there will be uk data for 2014 , on same column above uk there should be another data for france 2014 . X axis remains Same i.e 2014 but in single column stack there it will be all 4 state data for 2014 years. and the colour should be different for all stack.
Above image is that what i have tried .
Below image is one that i need .
Please Help me As Soon as Possible , So i can implement it .
Sir i know , this one and tried also but i want it in one single array and to show all stack in single series .
<e-series [dataSource]='Chartdata' type='StackingColumn' xName='x' yName='y' width='2'> </e-series>
I don't want to use multiple series to display and to display single stack which include all 4 country data into one object array
public Chartdata: Object[] = [
{ x: '2014', y: 200 }, {x: '2014', y: 125 }, { x: '2014', y: 66.1 }, { x: '2014', y: 34.1 }
];
like this one code ab
.
|
<ejs-chart>
<e-series-collection>
<e-series pointColorMapping='color'> </e-series>
</e-series-collection>
</ejs-chart>
public data: Object[] = [
{ x: '2014', y: 200, color:'red' },
{ x: '2014', y: 125, color:'blue' },
{ x: '2014', y: 66.1, color:'green' },
{ x: '2014', y: 34.1, color:'yellow' }
]; |
Hello Team ,
I want to know that for the above solution , How i should show different legends for different color stack .
Because ,when i am trying than it is showing only one legend , but i want 4 legends for which will display according to the color .
Code is same :
public Chartdata: Object[] = [
{ x: '2014', y: 200 }, {x: '2014', y: 125 }, { x: '2014', y: 66.1 }, { x: '2014', y: 34.1 }
];
and also tooltip hover should show specific stack name like if we hover on yellow stack so it will show
"color Germany : 124"
color is legend color which is in circle shape.
legendsShape='Circle'
but i want it ASAP , Please reply fast .
And thank you for the color solution
which property is similar to setExtremes in syncfusion angular chart
This code is in highcharts but i can't get any property similar to this setExtremes . So please help
|
// add your additional code here
<ejs-chart style='display:block;' [chartArea]='chartArea' [primaryXAxis]='primaryXAxis' (axisRangeCalculated)='axisRangeCalculated($event)' [primaryYAxis]='primaryYAxis' [zoomSettings]='zoomSettings' [title]='title' [tooltip]='tooltip' (load)='load($event)'>
// add your additional code here
public axisRangeCalculated(args: IAxisRangeCalculatedEventArgs): void {
if (args.axis.name == 'primaryXAxis') {
console.log('Xmax : ' + args.maximum + ' ; Xmin : ' + args.minimum);
}
if (args.axis.name == 'primaryYAxis') {
console.log('Ymax : ' + args.maximum + ' ; Ymin : ' + args.minimum);
}
}
// add your additional code here
|
Hello Team ,
Thank You for your all solutions.
Here i'm looking for some function like , when there is no data in data set or in database to display on chart than in the chart it should give message that "No Data to Display" .
And i want this function for below Charts :
1: Bar Chart
2: HeatMap Chart
3: Pie Chart
4: Spline Chart
5: Tree Chart
6: Table Chart
7: Column Stack Chart
Below image is one example for what we want :
Please Reply ASAP , So i can implement it fast .
Thank You.
|
<div id="div1" style="display:none" align='center'> No Data To Display</div> <br>
<div id="div2" style="display:none" align='center'> No Data To Display</div> <br>
//…
public load1(args: ILoadedEventArgs): void {
this.noData(args, "div1");
};
public load2(args: IAccLoadedEventArgs): void {
this.noData(args, "div2");
};
//…
public noData(args, name){
var count = 0;
for(var i = 0; i < args.chart.series.length; i++) {
if (args.chart.series[i].dataSource["length"] == 0 )
count = count + 1;
}
if(count == args.chart.series.length)
{
document.getElementById(name).style.display = "block";
args.cancel = true;
}
} |
|
if (
this.hm.dataSource.length == 0 ||
this.hm.dataSource.length == undefined
) {
document
.querySelector('#container_Container_TextGroup')
.getElementsByTagName('text')[0].innerHTML = 'No data to display!';
}
} |
|
[.html]
<div id="div1" style="display: grid;margin-left: 36%; padding-left: 75px;"> No Data To Display</div> <br>
<div id="diagramControl" class="control-section diagram-organizationalchart" style="display: none;">
<div class="col-lg-8 control-section">
<div class="content-wrapper">
<ejs-diagram #diagram id="diagram" width="100%" height="700px" [getConnectorDefaults]='connDefaults'
[getNodeDefaults]='nodeDefaults' [layout]='layout' [dataSourceSettings]='data' [tool]='tool'
[snapSettings]='snapSettings' (dataLoaded)="dataLoaded($event)">
</ejs-diagram>
</div>
</div>
</div>
[.ts]
public dataLoaded(arg) {
if (this.diagram.nodes.length) {
document.getElementById('diagramControl').style.display = 'block';
document.getElementById('div1').style.display = 'none';
}
} |
Hello Team ,
If there is less Data than annonation shows properly but data goes in thousands than it overlap on top of the stack and in this we don't have to use intervals and also we don't want to use co-ordination point like x=0 , y=45 .
Refer Below Images :
for Less Data :
for Large Data :
Please Reply ASAP , that we can implement ,
Thank You
|
<e-annotations>
<e-annotation
content='<div id="point1" style="font-size:11px;font-weight:bold;color:gray;fill:gray;"><span>12</span></div>'
x='2014' y='0' coordinateUnits='Point' region='Series'>
</e-annotation>
</e-annotations>
public annotationRender(args: IAnnotationRenderEventArgs): void {
let length = (this.chart.series[0] as Series).points.length - 1;
let value: number = 0;
for (let i: number = 0; i <= length; i++) {
value += this.chart.visibleSeries[0].stackedValues.endValues[i];
}
args.content.children[0].children[0].innerHTML = value.toString();
args.location.y = (this.chart.series[0] as Series).points[
length
].symbolLocations[0].y;
} |