-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
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
Line chart and bar graph #4269
Comments
This would be very cool. Also look at this: #1564 |
@sidharthv96 @knsv I will take this up what should be the Ideal syntax over here? |
@amsubhash you can give a shot at coming up with a syntax. We can then discuss and finalize it. |
Multiple dimensions would be perfect. ;-) |
Here is a rough structure I am thinking of
we can add multiple charts ( line | bar ) but we should have a common x-axis, and we can have 2 y-axis and each plot will comply to any of the y-axis I have put the left and right with y-axis so we can have two y-axis in both side. |
The syntax needs to be able to scale to 4 or even 8 options for the chart mode It could also need a way to make a combination of the values.. An array might be ideal for that |
Hi, @zm-cttae can you please provide an example config that will help us understand better? |
This is off the top of my head, we could make it The data formats are what need some thoughts on.
Below are some different types of how data can be added.
|
Hi everyone, I will suggest having the config so that we are able to add multiple plots, like bar and line in the same chart.
cc: @sidharthv96 |
I'm also thinking "XY scatter graph with trend line 📈" is an important use case especially for performance testing |
@amsubhash your grammar looks good, we can use that to start and iterate later if required. More than the grammar, I'm concerned about edge cases and maintaining the renderer for all these types. |
@sidharthv96 I am thinking of architecture like this, the complex part is the space management and that will be common for all types of plots. in this architecture, we can easily add plots and axis as we need. and for axis and plot, we will be using d3js. classDiagram
direction BT
ChartComponent "1..*" --* Orchestrator
Plot --|> ChartComponent
Axis --|> ChartComponent
Title --|> ChartComponent
Legend --|> ChartComponent
Plot o-- "2" Axis
LinePlot --|> Plot
BarPlot --|> Plot
LinearAxis --|> Axis
BandAxis --|> Axis
class Orchestrator{
+ChartConfig chartConfig
+ChartData chartData
-ChartComponent[] chartComponents
+getDrawableElement()
}
class ChartComponent{
<<interface>>
+setOrientation()
+calculateSpace()
+setBoundingBoxXY()
+getDrawableElement()
}
class Axis{
<<interface>>
+getScaleValue()
+setRange()
}
class Plot{
<<interface>>
-Axis xaxis
-Axis yaxis
+setAxies()
}
class LinearAxis{
}
class BandAxis{
}
class Title{
}
class Legend{
}
class LinePlot{
}
class BarPlot{
}
|
If the chartData structure is the same for all these charts, this feels like a solid approach. 👍 One anomaly that comes to my mind is stackedBarCharts. Can we handle that? Maybe we'll need a new syntax for it. |
You didn't post an answer to your question ;-) I think stacked bar charts are really important and missing this type of chart can often not be circumvented by just using a different chart type. |
Stacked bar are regular bar charts, just only the bars are stacked ones over others. Just a boolean flag would do the job here. |
+1 for Stacked Bar Charts and potentially allowing more than 1 line would be useful asper the OP, maybe something like this where bars can be stacked and controlled with boolean like
|
Proposal
Some people need only a simple line chart or bar graph. ;-)
Use Cases
No response
Screenshots
This would be very good:
Code Sample
No response
The text was updated successfully, but these errors were encountered: