apexcharts / ng-apexcharts

ng-apexcharts is an implementation of apexcharts for angular. It comes with one simple component that enables you to use apexcharts in an angular project.
MIT License
330 stars 81 forks source link

plotOptions property seems to have no effect in Angular #257

Closed mw108 closed 3 months ago

mw108 commented 1 year ago

These two examples are equal. While the plotOptions property works as expected in the JavaScript version, it seems to be ignored in the Angular version.

JavaScript: https://codepen.io/mw-108/pen/ExeRYer

grafik

Angular: https://codesandbox.io/s/gifted-cloud-pxvvc3?file=/src/app/app.component.ts

grafik

mw108 commented 1 year ago

No feedback here in over 1 month. Am I the only one having this issue? Is it an issue with ngApexCharts or an error on my side?

caboodal commented 9 months ago

I've tried and I can't get the plotOptions to have any impact either and I cannot turn off the dataLabels either and I'm using the latest 1.9.0 release

mw108 commented 9 months ago

I abandoned Apexcharts and switched to Apache ECharts: https://echarts.apache.org/en/index.html

caboodal commented 9 months ago

after a bit more investigation I realised that I wasn't binding the option classes to the chart!

So to clarify everything is working perfectly.

mw108 commented 9 months ago

I see, you are right. Wow. Such a simple pitfall. 🙈

<div id="chart-wrap">
  <apx-chart
    id="chart"
    [series]="chartOptions.series"
    [chart]="chartOptions.chart"
    [plotOptions]="chartOptions.plotOptions" <-- Add this
    [dataLabels]="chartOptions.dataLabels"
    [markers]="chartOptions.markers"
    [title]="chartOptions.title"
    [fill]="chartOptions.fill"
    [stroke]="chartOptions.stroke"
    [colors]="chartOptions.colors"
    [legend]="chartOptions.legend"
    [yaxis]="chartOptions.yaxis"
    [xaxis]="chartOptions.xaxis"
    [tooltip]="chartOptions.tooltip"
    [grid]="chartOptions.grid"
    [autoUpdateSeries]="false"
  ></apx-chart>
</div>
github-actions[bot] commented 4 months ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.