carbon-design-system / carbon-charts

:bar_chart: :chart_with_upwards_trend:⠀Robust dataviz framework implemented using D3 & typescript
https://charts.carbondesignsystem.com
Apache License 2.0
910 stars 184 forks source link

Charts are not working with latest version 1.15.7 #1820

Open jreddy2024 opened 6 months ago

jreddy2024 commented 6 months ago

Application/Team

IBMT

What happened?

Option names are not appearing in Graphs menu. Its showing blank names. using latest version - 1.15.7 image

Expected is - using older version 1.13.4 image

Version

"@carbon/charts-react": "1.15.7",

Data & options used

options: {
                title: 'Total HBCU User course enrollments',
                data: {
                    selectedGroups: [],
                },
                axes: {
                    left: {
                        mapsTo: 'value',
                        scaleType: 'linear',
                        title: 'Volume',
                    },
                    bottom: {
                        mapsTo: 'key',
                        scaleType: 'labels',
                        title: 'Date',
                    },
                },
                legend: {
                    order: [],
                },
                toolbar: {
                    enabled: true,
                    numberOfIcons: 3,
                    controls: [
                        {
                            type: 'Show as data-table',
                        },
                        {
                            type: 'Make fullscreen',
                        },
                        {
                            type: 'Custom',
                            text: 'Export as XLS',
                            clickFunction: () => {
                                this.download();
                            },
                        },
                        {
                            type: 'Custom',
                            text: 'Sort by Year',
                            clickFunction: () => {
                                this.updateGrpah('Year');
                            },
                        },
                        {
                            type: 'Custom',
                            text: 'Sort by Month',
                            clickFunction: () => {
                                this.updateGrpah('Month');
                            },
                        }
                    ],
                },
                color: {
                    scale: {},
                },
                curve: 'curveMonotoneX',
                height: '400px',
            },

<div className='bx--col-lg-10'>
                            <LineChart data={this.state.data} options={this.state.options}></LineChart>
                        </div>

Relevant log output

No response

StackBlitz example

No response

What priority level would this be in your opinion?

P1

nstuyvesant commented 5 months ago

Here is a StackBlitz repro with made-up data... https://stackblitz.com/edit/react-2njdag?file=src%2Foptions.js,src%2Fdata.js

nstuyvesant commented 5 months ago

@jreddy2024 - can you please rename this issue to "Custom names for toolbar dropdowns not working in @carbon/charts-react 1.15.7+"?