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

Add support for stacked bar chart #17

Merged
merged 7 commits into from
Aug 31, 2022
Merged

Conversation

mkrecek234
Copy link
Contributor

@mkrecek234 mkrecek234 commented Aug 18, 2022

Adding feature to support stacked bars.

Also additional default colour for longer datasets added.

@mvorisek mvorisek force-pushed the feature_stacked_bar_chart branch from c8dc50d to 0b15108 Compare August 18, 2022 22:10
@mvorisek mvorisek changed the title Support for stacked bar chart Add support for stacked bar chart Aug 18, 2022
@@ -28,11 +28,15 @@ class Chart extends View
['rgba(75, 192, 192, 0.2)', 'rgba(75, 192, 192, 1)'],
['rgba(153, 102, 255, 0.2)', 'rgba(153, 102, 255, 1)'],
['rgba(255, 159, 64, 0.2)', 'rgba(255, 159, 64, 1)'],
['rgba(20, 20, 20, 0.2)', 'rgba(20, 20, 20, 1)'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this come from some design guide? can this can abstracted for unlimited colors?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current Colour scheme looks nice and can well be used, I would not abstract or generalize it: devs should change if they prefer other colour coding

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems the original colors come from https://www.chartjs.org/docs/3.9.1/#creating-a-chart example /wo any specific design guide/logic

@mvorisek
Copy link
Member

please add a simple demo usage to /demos/index.php, this file is currently not tested by CI, but better to have a manual test than no test

@mvorisek mvorisek force-pushed the feature_stacked_bar_chart branch from f22275d to 837c0c5 Compare August 20, 2022 08:19
@mvorisek mvorisek force-pushed the feature_stacked_bar_chart branch from 837c0c5 to 014bd37 Compare August 27, 2022 19:56
@DarkSide666
Copy link
Member

Added LineChart
Added BarChart->setHorizontal()
Improved demos


namespace Atk4\Chart;

class LineChart extends Chart
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This complicates any extension in user projects... Not sure if different chart type that does not need additional modifications needs a custom class.

Copy link
Member

@DarkSide666 DarkSide666 Aug 31, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There can be modifications in future is someone will be ready to contribute them :)
I think each chart type should have it's own class even if it is mostly empty. Also maybe some parts from generic Chart class should go to extended chart classes.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am fine with this for now.

{
$this->type = 'horizontalBar';

// in chartjs 3.9.1 replace with
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

better to upgrade to the latest lib now

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

will do

@DarkSide666 DarkSide666 merged commit da73046 into develop Aug 31, 2022
@DarkSide666 DarkSide666 deleted the feature_stacked_bar_chart branch August 31, 2022 12:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants