liferay / clay

A web implementation of the Lexicon Experience Language
http://clayui.com
Other
208 stars 483 forks source link

Charts design? #459

Closed bryceosterhaus closed 4 years ago

bryceosterhaus commented 6 years ago

Hey, I was wondering what the goal for charts is. Are we expecting that clay-charts will match lexicon design? For example, I am looking at the pie chart at https://lexicondesign.io/docs/patterns/Charts/charts.html and noticed that the legend has the actual percentage value for the label. Is that something that will be available out of the box for charts? Also, for bar charts, will it work out of the box to have multiple bars and labels with different colors?

These are the designs I am hoping for that would work out of the box for charts.

screen shot 2018-01-24 at 4 10 54 pm screen shot 2018-01-24 at 4 10 44 pm
bryceosterhaus commented 6 years ago

cc @jbalsas

jbalsas commented 6 years ago

Hey @bryceosterhaus, it is definitely the goal of Clay to match Lexicon design out of the box with minimal effort. We'll double-check with the Lexicon team and work on these changes based on their feedback.

Could you share some kind of simple snippet of how you're using it? Just to make sure we reproduce the right thing?

Thanks for letting us know!

bryceosterhaus commented 6 years ago

We aren't doing anything special. We are just using it as is in JSX.

Very similar to https://hosting-metalcharts.wedeploy.io/avdanced-examples/x-axis-tick-formatting/ and https://hosting-metalcharts.wedeploy.io/simple-examples/pie/

julien commented 6 years ago

Hi @bryceosterhaus,

Concerning the labels, you could use the chart's legend option, which will let you set the position's position.

We need to add the missing (contents) property to support legend templates like in this example: https://naver.github.io/billboard.js/demo/#Legend.LegendTemplate2, which would let us customize the labels formatting.

Concerning the chart designs, we might need to review them with the UX team since legends usually contain rectangles instead of circles, but thinking of a solution, we could also solve it by providing custom templates if is a good option.

julien commented 6 years ago

Hey again @bryceosterhaus,

I added the missing contents property to the legend option.

It seems we might need to contribute to billboard.js, so that the "data" gets passed to the template function, because for the moment it only receives color and title as arguments.

bryceosterhaus commented 6 years ago

@julien Thanks for the response. I think it would also be helpful for the custom legend if we didn't have to create an additional html element to pass to it. Currently, if you add a custom legend it requires you to pass the bindto: "#legend", option. Also it seems weird that if you create a custom legend it is outside the chart svg, whereas the default legend is with the other chart elements.

julien commented 6 years ago

@bryceosterhaus, I agree and understand your concerns. This "API" is from billboard.js, so I guess we can to talk with them if we want to modify the current behaviour, or think of another solution. /cc @Robert-Frampton, do you have any thoughts on this?

thektan commented 6 years ago

Hi @julien! Just checking in to see if any additional progress has been made on this issue.

julien commented 6 years ago

Hi @thektan,

No additional progress has been made on this "issue".

If we want to match the design as it is seen in the screenshots we can do it with the legend option. If you have more doubts, I'll be glad to help.

jbalsas commented 6 years ago

Hey @victorvalle, @emilianocicero, could we get a final say on this design and what's the proper look of these charts?

The main differences from the current implementation are:

Thanks!

julien commented 6 years ago

After talking with @victorvalle and @EmilianoCicero,

We will:

If you have any doubts or feedback, please let us know. Thanks!

victorvalle commented 6 years ago

Related to:

jbalsas commented 4 years ago

Doing some spring-cleaning... closing all issues labeled as 2.x that are not type:bug since 2.x is in maintenance and we won't be proactively be taking these ones.

In this case we're in fact already working on https://github.com/liferay/clay/milestone/14, so no need to keep on this, but a good reminder of the conversation @bryceosterhaus!

Thanks!