Skip to content

Commit

Permalink
modified settings in the TreeSeries
Browse files Browse the repository at this point in the history
  • Loading branch information
deqingli committed Oct 13, 2017
1 parent a315dca commit fa119bf
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 49 deletions.
2 changes: 1 addition & 1 deletion src/chart/tree/TreeSeries.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ define(function (require) {

expandAndCollapse: true,

initialTreeDepth: 1,
initialTreeDepth: 2,

lineStyle: {
normal: {
Expand Down
36 changes: 4 additions & 32 deletions test/tree-basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,8 @@
chart.resize();
};

$.getJSON('./data/ec-option-doc-statistics-201604.json')
.done(function (rawData) {

function convert(source, target, basePath) {

for (var key in source) {
var path = key;
if (key.match(/^\$/)) {

}
else {
target.children = target.children || [];
var child = {
name: path
};
target.children.push(child);
convert(source[key], child, path);
}
}

if (!target.children) {
target.value = source.$count || 1;
}
}

var data = {name: 'option'};

convert(rawData, data, '');
$.getJSON('./data/flare.json')
.done(function (data) {

chart.setOption({

Expand All @@ -72,15 +46,13 @@

data: [data],

top: '2%',
top: '1%',
left: '7%',
bottom: '2%',
bottom: '1%',
right: '20%',

symbolSize: 7,

initialTreeDepth: 1,

label: {
normal: {
position: 'left',
Expand Down
34 changes: 20 additions & 14 deletions test/tree-legend.html
Original file line number Diff line number Diff line change
Expand Up @@ -156,16 +156,26 @@
"name": "flare",
"children": [
{
"name": "data",
"name": "flex",
"children": [
{
"name": "converters",
"children": [
{"name": "DelimitedTextConverter", "value": 4294}
]
}
{"name": "FlareVis", "value": 4116}
]
},
{
"name": "scale",
"children": [
{"name": "IScaleMap", "value": 2105},
{"name": "LinearScale", "value": 1316},
{"name": "LogScale", "value": 3151},
{"name": "OrdinalScale", "value": 3770},
{"name": "QuantileScale", "value": 2435},
{"name": "QuantitativeScale", "value": 4839},
{"name": "RootScale", "value": 1756},
{"name": "Scale", "value": 4268},
{"name": "ScaleType", "value": 1821},
{"name": "TimeScale", "value": 5833}
]
},
{
"name": "display",
"children": [
Expand Down Expand Up @@ -212,8 +222,6 @@

symbolSize: 7,

initialTreeDepth: 2,

label: {
normal: {
position: 'left',
Expand Down Expand Up @@ -243,15 +251,13 @@
name: 'tree2',
data: [data2],

top: '5%',
top: '20%',
left: '60%',
bottom: '2%',
right: '20%',
bottom: '22%',
right: '18%',

symbolSize: 7,

initialTreeDepth: 1,

label: {
normal: {
position: 'left',
Expand Down
2 changes: 0 additions & 2 deletions test/tree-vertical.html
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@

expandAndCollapse: true,

initialTreeDepth: 2,

label: {
normal: {
position: 'top',
Expand Down

0 comments on commit fa119bf

Please sign in to comment.