Comments (11)
@martynasma , I found the problem for the graph invisible in case CategoryAxis , we need add : xAxis.data.setAll(data);
for the probleme scrollbarX , you are right, I am making the modification
from amcharts5.
The code looks good at first glance. Can you also post your data?
from amcharts5.
@martynasma , simpe data:
series.data.setAll([
{label : "t1" , value : 10 },
{label : "t2" , value : 11 }
]);
I try with beta 7 , same issue
from amcharts5.
Replace:
valueXField: 'label' by valueXField: 'date', try datas retrieve for your doc site :
series.data.pushAll([{
date: new Date(2021, 0, 1).getTime(),
value: 1000
}, {
date: new Date(2021, 0, 2).getTime(),
value: 800
}, {
date: new Date(2021, 0, 4).getTime(),
value: 800
}, {
date: new Date(2021, 0, 5).getTime(),
value: 800
}]);
It's works , but poor quality and no preview in zoom bar
from amcharts5.
You have two ValueAxis and data that is supplying strings. You should probably use CategoryAxis
.
For how to configure XYChartScrollbar refer to this doc:
https://www.amcharts.com/docs/v5/charts/xy-chart/scrollbars/#Scrollbar_with_chart_preview
from amcharts5.
@martynasma see the first code, I had configured scrollbar with preview.
New code , same issue:
let root = am5.Root.new('linechartdiv');
root.setThemes([
am5themes_Animated.new(root)
]);
let chart = root.container.children.push(
am5xy.XYChart.new(root, {
panX: true,
wheelable : false,
wheelX : 'none',
wheelY : 'none'
})
)
// Add data
const data = this.resultData.results
? this.resultData.results.map(item => ({label: ` (${item.identifier})`, value: item.value})) : []
// Create axes
let xAxis = chart.xAxes.push(
am5xy.CategoryAxis.new(root, {
categoryField: "label",
renderer: am5xy.AxisRendererX.new(root, {})
})
);
let valueAxis = chart.yAxes.push(
am5xy.ValueAxis.new(root, {
renderer: am5xy.AxisRendererY.new(root, {})
})
);
// Create series
let series = chart.series.push(
am5xy.SmoothedXLineSeries.new(root, {
name : 'Results',
valueYField: 'value',
categoryXField : 'label',
xAxis : xAxis,
yAxis : valueAxis
}));
series.strokes.template.setAll({
strokeWidth: 2
});
console.table(data);
const cursor = chart.set("cursor", am5xy.XYCursor.new(root, { behavior: "zoomX" }));
cursor.lineY.set("visible", false);
let scrollbarX = am5xy.XYChartScrollbar.new(root, {
orientation: "horizontal",
height: 50,
});
chart.set("scrollbarX", scrollbarX)
series.data.setAll(data);
series.appear();
chart.appear();
from amcharts5.
I don't see any series being added to the scrollbarX. You might've missed that part in docs:
https://www.amcharts.com/docs/v5/charts/xy-chart/scrollbars/#Scrollbar_with_chart_preview
from amcharts5.
We have small issues with horizontal preview, when I drag the button ,pointer mouse is staggered.
It's possible to set font-family in chart to to have a smoother rendering
from amcharts5.
Let's keep this place clutter-free, both for our own sake and the other's. If you have other questions, not directly related to original topic, please post a separate issue.
from amcharts5.
This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.
from amcharts5.
@martynasma Looks like the bot has some issues, there's a bunch of stale posts that it didn't close.
from amcharts5.
Related Issues (20)
- adding connect : false results in the grouped series disappearing upon zooming. HOT 2
- States not setting up for each column in columnSeries HOT 1
- Facing issues with series.data.setAll() HOT 4
- Add current volume label to stock chart HOT 2
- Hierarchy charts - Tree Map - Data processor will work for one level ? HOT 3
- Data point possible accessibilities HOT 6
- Flickering effect occurring while disposing series to add new series with new data HOT 2
- Adding button with tooltip of valueAxis stock chart HOT 4
- Increase the sensitivity of the panining AxisRendererY HOT 1
- Disable PanY auto resetting for valueAxis amcharts Stock HOT 2
- Can we add custom drawing tool in the same way as we add custom indicators HOT 3
- Chart specific possible accessibilities HOT 7
- Column series getting clustered after adding more data HOT 8
- Legend label oversizedBehaviour without maxWidth HOT 4
- Can't add tooltip on hover on X axis item HOT 3
- minBulletDistance not working for a Gantt chart with CategoryAxis and DateAxis HOT 3
- Violin Chart Possible with amcharts5? HOT 2
- How to fire the drawing tool on the button active. HOT 8
- Enhancement : Drawing should get extend on lazy loading.
- The word cloud graphic presents the blurred emojis in the Firefox browser HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from amcharts5.