-
Notifications
You must be signed in to change notification settings - Fork 102
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
feat: add SimpleGraph class #8
Conversation
Please @frank-zsy help look into this and see if there are anything needed but not implemented yet, or totally unnecessary.
In the current implementation, While BTW, is it necessary to move the WDYT @frank-zsy ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We may use single quotes rather than double quotes for strings, is there a certain reason you change all quotes to double quotes?
And I think besides the
I think it is all good, if you move the class into another file, need to add it to |
Signed-off-by: LinHaiming <lhming23@outlook.com>
I have updated the PR, please @frank-zsy have a look.
Because I used BTW, maybe we can specify the lint tool and configuration to avoid this problem.
I have added that to this pr, please review it again.
Yes. I have moved the |
I will approve this PR now and refactor later on default styles. /approve |
This PR implements the
SimpleGraph
class based onEcharts
. Fix #4.How to use
First, we need to prepare a DOM container with width and height for ECharts.
Then we can initialize an SimpleGraph instance to create a simple chart:
API
render(option)
This is the most powerful interface. All parameters and data can all be passed and modified through
option
.ECharts
will merge new parameters and data, and then refresh chart. The function can be used to:Dynamic Data Updating
Implementing dynamic data updating is extremely easy. You only need to get data as you wish, fill in data to
option
, then pass it torender()
.Asynchronous Loading
The same as
Dynamic Data Updating
. You can pass theoption
torender()
once the data is ready after asynchronous loading.Loading Animation
showLoading()
is used to show the simple loading animation, andhideLoading()
is used to hide it after data loading.Theme
Besides the original default theme, you can use 'light' and 'dark' theme:
You can also call
updateTheme(theme)
to update the theme color.Events
bindEvent(eventName, func)
is provided to bind some events on the chart and handle accordingly through callback functions. You can refer to Events and Actions in ECharts for more information.Actions
dispatchAction()
is provided to trigger certain actions in the program, such as showing tooltip, or selecting legend. You can refer to action for more information.Signed-off-by: LinHaiming lhming23@outlook.com