Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Chart component #24357

Merged
merged 56 commits into from
Sep 14, 2023
Merged

Adding Chart component #24357

merged 56 commits into from
Sep 14, 2023

Conversation

Benjin
Copy link
Contributor

@Benjin Benjin commented Sep 9, 2023

Example charts:
image

Adding support for charts as componentModel UI pieces, powered by Chart.js. This PR also updates the sqlservices extension with samples for each graph type.

Though this is underpinned by Chart.js, the API is abstracted from it, giving us flexibility to change charting libraries in the future.

Big thanks to @deepaksa1, who I worked with on this PR.

Initial support includes:

  • bar, horizontal bar, line scatterplot, pie, doughnut, bubble, radar, and polar area charts
  • ability to set data series colors
  • ability to set height and width of charts
  • ability to update data in chart without destruction/recreation
  • ability to mix in Chart.js options that aren't explicitly supported in the API

deepaksa1 and others added 30 commits March 29, 2023 05:53
* working - displaying chart data with convert

* working - introduced typed properties

* working, added BarChartConfiguration to type param

* removed ChartProperties type param

* Adding doughnut support

* Correcting number vs. point issue

* including the right changes this time

* commenting out no-longer-used labels prop
src/sql/azdata.proposed.d.ts Outdated Show resolved Hide resolved
src/sql/azdata.proposed.d.ts Show resolved Hide resolved
src/sql/azdata.proposed.d.ts Outdated Show resolved Hide resolved
src/sql/base/browser/ui/chart/chart.component.ts Outdated Show resolved Hide resolved
src/sql/base/browser/ui/chart/chart.component.ts Outdated Show resolved Hide resolved
src/sql/azdata.proposed.d.ts Outdated Show resolved Hide resolved
samples/sqlservices/src/controllers/mainController.ts Outdated Show resolved Hide resolved
src/sql/base/browser/ui/chart/chart.component.ts Outdated Show resolved Hide resolved
src/sql/base/browser/ui/chart/chart.component.ts Outdated Show resolved Hide resolved
src/sql/azdata.proposed.d.ts Outdated Show resolved Hide resolved
src/sql/azdata.proposed.d.ts Outdated Show resolved Hide resolved
@Benjin Benjin merged commit d9b5d71 into main Sep 14, 2023
4 of 6 checks passed
@Benjin Benjin deleted the deepaksa1/chartComponent branch September 14, 2023 03:11
siyao-Siyang pushed a commit that referenced this pull request Oct 12, 2023
* added doughnut chart component

* Changing chart to doughnutChart

* reverting to genreic chart component

* adding more chart supoort

* fix minor errors

* resolve some PR comments

* native chartjs, keyboard navigation and chart options

* fix build errors

* fix chart.js/auto error

* resolve PR comments

* modify chartdataset API

* Refactoring (#24327)

* working - displaying chart data with convert

* working - introduced typed properties

* working, added BarChartConfiguration to type param

* removed ChartProperties type param

* Adding doughnut support

* Correcting number vs. point issue

* including the right changes this time

* commenting out no-longer-used labels prop

* remove hardcoded canvasID, enabled Scatterplot config

* Moved graph testing to sample extension

* Reorganizing types; adding test back to assessment dialog

* Adding example for bubble chart

* Polar area working

* cleanup

* adding draw when options isn't set

* Moving chart example configs to other file

* some cleanup

* added some docstrings

* add multiple datasets to test scatter plot

* update scatter plot example in sample

* Adding height/width support

* swapping to `as` cast

* title working

* Settling chart title and legend display

* Adding comments

* updating data working

* Updating samples

* Typo in comment

* Reverting changes made for development

* Elaborating on color in docstrings

* Separating Data and Options in component payloads

* Removing chartId as an exposed property

* Changing chartType property to TChartType

* Fleshing out types file comments

* fixing scoping of chart component properties; renaming chart canvas ID prop

* correct internal chart options typing

* removing commented-out code

* removing unused ChartClickEvent type until data selection eventing is implemented

* renaming function

* deleted commented-out code

* Adding options setters that went missing after splitting Config to Data + Options

* adding type predicates for data conversion

* Adding back type setting (dropped when chart type conversion moved)

* Narrowing type for 'type'

* Fixing typos in docstring

---------

Co-authored-by: Deepak Saini <[email protected]>
Co-authored-by: Charles Gagnon <[email protected]>
Co-authored-by: Aasim Khan <[email protected]>
Co-authored-by: Deepak Saini <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants