Closed abhayjain2023 closed 1 year ago
The code you provided is for amCharts v3, not v4, so this is the wrong repo. v3 is no longer supported.
@xorspark This code is for Amchart4
var chart = AmCharts.makeChart("chartdiv", { "pathToImages": "../images/", "type": "stock", "theme": "none", "precision": 1, "dataSets": dataArray, "panels": [{}], "periodSelector": { "position": "bottom", "color": "#002c77", "dateFormat": "YYYY", "fromText": PeriodText, "toText": "- ", "periods": [ { period: "YYYY", count: 1, label: "1 Y" }, { period: "YYYY", count: 2, label: "2 Y" }, { period: "YYYY", count: 4, label: "4 Y" }, { period: "YYYY", count: 8, label: "8 Y" }, { period: "MAX", selected: true, label: "Max" } ], } })
@abhayjain2023 - No it's not. AmCharts.makeChart is v3. There is no such method in v4.
In addition, those CSS class names are in v3's stock chart period selector.
Here's a comparison:
"When I focus on the .amcharts-end-date-input and .amcharts-start-date-input, and then click outside the input box, the year's value automatically decreases by 1. For example, if the current value is 2022 and I focus on the input box and then click outside it, the value changes to 2021. This same scenario occurs every time in both input boxes."
Here is the below image for reference, also I have attached the code snippet.
` var chart = AmCharts.makeChart("chartdiv", { "pathToImages": "../images/", "type": "stock", "theme": "none", "precision": 1, "dataSets": dataArray, "periodSelector": { "position": "bottom", "color": "#002c77", "dateFormat": "YYYY", "fromText": PeriodText, "toText": "- ", "periods": [ { period: "YYYY", count: 1, label: "1 Y" }, { period: "YYYY", count: 2, label: "2 Y" }, { period: "YYYY", count: 4, label: "4 Y" }, { period: "YYYY", count: 8, label: "8 Y" }, { period: "MAX", selected: true, label: "Max" } ], } })
`
@martynasma Can you please help me in this?