Amcharts: the last day of the period is not accessible for cursor
Amcharts: the last day of the period is not accessible for cursor
I think have some troubles understanding the use of usePeriod
property in chartScrollbarSettings
usePeriod
chartScrollbarSettings
When I specify the period I can't access the last day (or even the nearest one if there is no data for particular day)
As far as I understand for the large datasets AmCharts
downsample the lager daily data to weeks to speed up renedering.
But the last day of the period is crucial day - and the data must be shown on the graph.
AmCharts
These are my settings.
this.chart = window.AmCharts.makeChart("chartdiv", {
"path": AmCharts_path,
"type": "stock",
"theme": "light",
"dataSets": this.$store.getters.getPortfolio.map(function (port, idx) {
return {
"title": port.name,
"fieldMappings": [{
"fromField": "value",
"toField": "value"
}],
"dataProvider": port.data,
"compared": (idx === 0 ? false : true),
"categoryField": "date"
}
}),
"panels": [{
"title": "Value",
"percentHeight": 70,
"stockGraphs": [
{
"id": "g1",
"valueField": "value",
"comparable": true,
"compareField": "value",
"balloonFunction": this.ballonRender,
"compareGraphBalloonFunction": this.ballonRender
}]
}],
"chartScrollbarSettings": {
"graph": "g1",
},
"categoryAxis": {
"parseDates": true
},
"categoryAxisSettings": {
"minPeriod": "DD"
},
"balloon": {
"fixedPosition": true,
"maxWidth": 10000,
"offsetY": 1,
},
"dataDateFormat": "YYYY-MM-DD",
"chartCursorSettings": {
"valueBalloonsEnabled": true,
"categoryBalloonEnabled": true,
"categoryBalloonAlpha": 0.8,
"bulletsEnabled": true,
"bulletSize": 10,
"valueZoomable":true,
"categoryBalloonDateFormats": [
{period:'fff',format:'JJ:NN:SS'},
{period:'ss',format:'JJ:NN:SS'},
{period:'mm',format:'JJ:NN'},
{period:'hh',format:'JJ:NN'},
{period:'DD',format:'EEEE, MMM DD'},
{period:'WW',format:'EEEE, MMM DD'},
{period:'MM',format:'MMM'},
{period:'YYYY',format:'YYYY'}
]
},
"listeners": [{
"event": "zoomed",
"method": this.calulateMetrics
}],
"periodSelector": {
"position": "bottom"
},
I want somehow to prevent amchart
from downsampling my data. I see that for different datazoom
range the minimal step between two days is different. For example in monthly data I can go through every day, but for 1 year data I able only to navigate through weeks and that is not my case.
I tried to adjust the usePeriod
parameter, with categoryAxisSettings
but it didn't help me.
amchart
datazoom
usePeriod
categoryAxisSettings
Hope that there is a way to solve this problem
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.