-
Notifications
You must be signed in to change notification settings - Fork 106
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
Create pie chart #6
base: master
Are you sure you want to change the base?
Changes from 24 commits
166fce1
a7ec825
35c3dca
6ab898f
6d759f2
e6d9e84
6330d1d
780e595
03452f8
852ca26
19c08ed
aca08d8
c2a652f
dabe831
cf0c502
691b8f9
7ee1b35
f9c259d
a5425b6
2c9ae00
c441ed6
56bb1d7
ccb98c4
ceccfa3
d2871e9
3565a3e
70c624c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
pieEx1 = list( | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This does not look like a good example in my eyes. Ideally we should not require users to prepare a huge list for There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, it's my fault. It was just for testing on my own. I will give a simple example. |
||
title = list( | ||
text = 'Test', | ||
subtext = 'From d3.js', | ||
x = 'right', | ||
y = 'bottom' | ||
), | ||
tooltip = list( | ||
trigger = 'item' | ||
), | ||
toolbox = list( | ||
show = TRUE, | ||
feature = list( | ||
restore = list(show = TRUE), | ||
magicType = list(show = TRUE, type = c('pie', 'funnel')), | ||
saveAsImage = list(show = TRUE) | ||
) | ||
), | ||
legend = list( | ||
x = 'left', | ||
data = c('group1', 'group2', 'group3', 'group4') | ||
), | ||
series = list( | ||
list( | ||
type = 'pie', | ||
showScale = TRUE, | ||
showScaleText = TRUE, | ||
data = list( | ||
list(name = 'group1',value=10), | ||
list(name = 'group2',value=20), | ||
list(name = 'group3',value=5), | ||
list(name = 'group4',value=30) | ||
), | ||
itemStyle = list( | ||
normal = list( | ||
label = list(show = FALSE) | ||
) | ||
) | ||
|
||
) | ||
) | ||
) | ||
echart(pieEx1) |
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.
I'd prefer a separate function to do these configurations, e.g. something like
eChart() %>% eConfig(calculable = TRUE) %>% eToolbox(show = TRUE, feature = ...)
. It is fine to hard-code some options insideechart()
, but we should make it possible for users to change these options at the same time.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.
I will give a new function for options.