Comments (2)
horizontalBar is not a supported chart type according to ChartJs docs: https://www.chartjs.org/docs/latest/charts/area.html
from ng2-charts.
I feel you are supposed to be able to make a horizontal bar chart by setting it under the options for the bar chart in question.
options: { indexAxis: y }
The documentation in chart.js shows that you should be able to make a horizontal bar chart through setting the indexAxis to why under options: https://www.chartjs.org/docs/latest/samples/bar/horizontal.html
It does not seem this is supported in ng2-charts
For example, the following does not work:
(properties in myChart.component.ts)
public lineChartOptions = {
indexAxis: 'y',
responsive: true
};
public lineChartLabels = ['January', 'February', 'March', 'April', 'May', 'June', 'July'];
public lineChartType : ChartType = 'bar';
public lineChartLegend = true;
public lineChartData = [
{ data: [65, 59, 80, 81, 56, 55, 40], label: 'Series A' }
];
(myChart.component.html)
div style="display: block; width: 50vw">
<canvas baseChart
[datasets]="lineChartData"
[labels]="lineChartLabels"
[options]="lineChartOptions"
[legend]="lineChartLegend"
[type]="lineChartType"
>
/div>
type error:
Type '{ indexAxis: string; responsive: boolean; }' is not assignable to type '_DeepPartialObject<CoreChartOptions & ElementChartOptions & PluginChartOptions<...> & DatasetChartOptions<...> & ScaleChartOptions<...>>'.
from ng2-charts.
Related Issues (20)
- Height of the chart HOT 1
- Showing not all values HOT 1
- Doughnut/Pie chart: Uncaught TypeError: Cannot read properties of undefined (reading 'display')
- "No such file or directory" when generating charts ng2-charts 5.0.3 HOT 1
- Can't bind *propertyname* since it isn't a known property of 'canvas'
- Support of rxjs v7 in v2.x HOT 1
- chartClick interface eventEmitter interface is incorrect HOT 1
- Can't create a Clustered Stacked Bar Chart as expected HOT 1
- Doughnut chart: Provide option to add text in center with v5.x HOT 1
- Add support for Angular 17 HOT 17
- Unable to resolve dependency issue HOT 6
- 217387
- Error when I try to set position: 'external' to the tooltip of a doughnut chart HOT 1
- Module '"ng2-charts"' has no exported member 'provideCharts', 'withDefaultRegisterables'. HOT 5
- "bar" is not a registered controller HOT 2
- Module '"ng2-charts"' has no exported member in v6 HOT 1
- V6 Annotation Typing issues HOT 3
- Integrate into Angular 17 project without standalone components HOT 1
- Could not resolve dependency Angular 16 @angular/[email protected] HOT 1
- v6 with Angular 17, cant bind properties 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 ng2-charts.