-
Notifications
You must be signed in to change notification settings - Fork 316
增加了 Level 层级图 和 ChineseMap图 #137
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
Open
alsotang
wants to merge
18
commits into
TBEDP:master
Choose a base branch
from
hlqf:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
7757eaa
add level chart. Chinese map has been set in ./example/chinamap
45d2dd6
add example image for level chart
647f4ed
add level chart example image
e8ed13b
add chinese map chart and its example in README.md
54a752e
update url of images
390a267
update a describe error
dedaf6a
增加层级图分条
c61ea43
修改了画布初始化方式, 增加多条柱图时的hover效果, 修改多条时的基线样式以使表现更加清晰.
8965728
update README.md for emphasizing differences with original Master
02704e6
add level_duo.jpg image example
e0a37ef
add tiflevel chart for Chart-Selector.
ba8d303
update README.md for better typesetting
354276d
update README.md for better typesetting
9ff41ac
the same
1ca5a1a
Add barLevelSelector
2f14b95
Add another styles of gender chart
9b49196
Add vertical tirbarlevel chart
27086e5
fix tiflevel2
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | ||
| <title>Document</title> | ||
| <script src="../../build/deps.js"></script> | ||
| <script src="../../lib/datav.js"></script> | ||
| <script src="../../lib/charts/level.js"></script> | ||
| <style> | ||
| .level { | ||
| padding: 10px; | ||
| margin: 10px; | ||
| height: 235px; | ||
| width: 300px; | ||
| overflow: hidden; | ||
| float: left; | ||
| } | ||
| .level2 { | ||
| padding: 10px; | ||
| margin: 10px; | ||
| height: 235px; | ||
| width: 500px; | ||
| overflow: hidden; | ||
| float: left; | ||
| } | ||
| .clr { | ||
| clear: both; | ||
| } | ||
| </style> | ||
| </head> | ||
| <body> | ||
| <div class="level"></div> | ||
| <div class="level"></div> | ||
| <div class="level"></div> | ||
| <div class="level"></div> | ||
| <div class="level"></div> | ||
| <div class="clr"></div> | ||
| <div class="level2"></div> | ||
| <script> | ||
| /** | ||
| * Examples about how to use LevelChart | ||
| * var tester = new LevelChart(DomNode); //init levelchart | ||
| * tester.render([ Array data ],{ Object globalBase: [Array globalBascialData], labels : [Array labelTypes], tipImg : "String image url for giving a tip" }, nobase : Boolean true/false ); | ||
| */ | ||
|
|
||
| //To draw charts in different data env | ||
| var tester = new LevelChart($('.level:eq(0)')); | ||
| tester.render([ 10, 20, 30, 49, 50 ]); | ||
|
|
||
| var tester = new LevelChart($('.level:eq(1)')); | ||
| tester.render([ 10, 35, 88, 49, 10 ], { globalBase : [ 10, 20, 50, 30, 15], labels : [ 'a', 'b', 'c', 'd', 'e' ] }); | ||
|
|
||
| var tester = new LevelChart($('.level:eq(2)')); | ||
| tester.render([ 0, 0, 0, 0, 0 ], { globalBase : [ 10, 20, 50, 30, 15], labels : [ 'a', 'b', 'c', 'd', 'e' ] }); | ||
|
|
||
| //When there is no baseline, the hover effects won't be shown. | ||
| var tester = new LevelChart($('.level:eq(3)')); | ||
| tester.render([ 10, 35, 88, 49, 10 ], { nobase : true }); | ||
|
|
||
| //You could use your own images for marking the baseline on the top-right of the chart now! | ||
| var tester = new LevelChart($('.level:eq(4)')); | ||
| tester.render([ 10, 35, 88, 49, 10 ], { globalBase : [ 0, 0, 5, 0, 0], tipImg : 'http://img03.taobaocdn.com/tps/i3/T1iTjQXXXbXXc_eAHa-19-18.png' }); | ||
|
|
||
| //When there is no baseline, the hover effects won't be shown. | ||
| var tester = new LevelChart($('.level2:eq(0)'), { | ||
| "width": 400, | ||
| "height": 235, | ||
| }); | ||
| tester.render([[ 10, 35, 88, 49, 10 ],[ 15, 45, 78, 40, 10 ]], { globalBase : [[ 10, 20, 70, 30, 5 ], [ 10, 35, 70, 40, 15 ]]}); | ||
|
|
||
| </script> | ||
| </body> | ||
| </html> | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <title>Demo</title> | ||
| <script src="../../build/deps.js"></script> | ||
| <script src="../../lib/datav.js"></script> | ||
| <!--<script src="../../lib/charts/tifbarlevel.js"></script>--> | ||
| <!--If you need to roate the chart, you should use tifbarlevel2.js--> | ||
| <script src="../../lib/charts/tifbarlevel2.js"></script> | ||
| </head> | ||
| <body> | ||
| <div id="demo1"></div> | ||
| <script> | ||
| var chart = new TifBarLevel({ | ||
| container: "demo1", | ||
| width: 300, | ||
| height: 200, | ||
| data: [{name: "白富美", value: 40}, {name: "高富帅", value: 60}, {name: "穷屌丝", value: 34}, {name: "女汉子", value: 45}], | ||
| clickHandle: function (d, i) { | ||
| console.log(d); | ||
| console.log(i); | ||
| }, | ||
| margin: { | ||
| top: 40, | ||
| bottom: 30, | ||
| left: 60, | ||
| right: 90 | ||
| } | ||
| }); | ||
| </script> | ||
| </body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <title>Demo</title> | ||
| <script src="../../build/deps.js"></script> | ||
| <script src="../../lib/datav.js"></script> | ||
| <script src="../../lib/charts/tifgender.js"></script> | ||
| </head> | ||
| <body> | ||
| <div id="demo1"></div> | ||
| <script> | ||
| var chart = new TifGender({ | ||
| container: "demo1", | ||
| width: 326, | ||
| height: 190, | ||
| data: [{name: "男", value: 55}, {name: "女", value: 45, color: "#ff88a2"}], | ||
| clickHandle: function (d, i) { | ||
| console.log(d); | ||
| console.log(i); | ||
| }, | ||
| margin: { | ||
| top: 50, | ||
| bottom: 30, | ||
| left: 20, | ||
| right: 20 | ||
| } | ||
| }); | ||
| </script> | ||
| </body> | ||
| </html> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,64 @@ | ||
| <!doctype html> | ||
| <html lang="en"> | ||
| <head> | ||
| <meta charset="UTF-8"> | ||
| <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | ||
| <title>Document</title> | ||
| <script src="../../build/deps.js"></script> | ||
| <script src="../../lib/datav.js"></script> | ||
| <script src="../../lib/charts/tiflevel.js"></script> | ||
| <style> | ||
| </style> | ||
| </head> | ||
| <body> | ||
| <div class="level" id="tiflevel-demo1"></div> | ||
| <div class="level" id="tiflevel-demo2"></div> | ||
| <script> | ||
| //Init params for chart and darw the picture; | ||
| var tifLevel = new TifBuyerLevel({ | ||
| container: "tiflevel-demo1", | ||
| width: 326, | ||
| height: 190, | ||
| margin: { | ||
| top: 60, | ||
| bottom: 100, | ||
| left: 30, | ||
| right: 50 | ||
| }, | ||
| clickHandle: function (d, i) { | ||
| console.log(d); | ||
| console.log(i); | ||
| }, | ||
| }); | ||
|
|
||
|
|
||
| var tifLevel = new TifBuyerLevel({ | ||
| container: "tiflevel-demo2", | ||
| width: 326, | ||
| height: 190, | ||
| margin: { | ||
| top: 60, | ||
| bottom: 100, | ||
| left: 30, | ||
| right: 50 | ||
| }, | ||
| data: [{name: "白富美", value: 40}, {name: "高富帅", value: 30}, {name: "穷屌丝", value: 20}, {name: "女汉子", value: 15}], | ||
| clickHandle: function (d, i) { //event after click the bar or the tag,use console to show up. | ||
| console.log(d); | ||
| console.log(i); | ||
| }, | ||
| }); | ||
| //Add mark for some sections, you could use imgages like this. | ||
| tifLevel.paper.image("http://shu.taobao.com/assets/images/buyer_level_heart.png", tifLevel.leftArr[0] - 8, tifLevel.config.margin.top - 18, 18, 18) | ||
| .attr({"title": "段落标记"}); | ||
| tifLevel.paper.image("http://shu.taobao.com/assets/images/buyer_level_heart.png", tifLevel.leftArr[1] - 9, tifLevel.config.margin.top - 18, 18, 18) | ||
| .attr({"title": "MarkII"}); | ||
| tifLevel.paper.text(20, 30, "图表选择器").attr({ | ||
| "font-family": "微软雅黑", | ||
| "font-size": "14px", | ||
| "text-anchor": "start" | ||
| }); | ||
|
|
||
| </script> | ||
| </body> | ||
| </html> |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
这个 tipImg 是特意加上的吗??是个新浪微博的图标。
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.
为增强自定义,他们需要的baseline可能不称之为"全网基数",所以可以自定义图片. 在shu上面找了没找到什么合适的图片,于是放了微博的那个. 不太美观的话,一会儿ps一个替换掉
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.
不填写tipImg属性的时候,默认就是全网参数了的.
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.
嗯嗯,就留着吧。