Skip to content

Commit

Permalink
Force category的默认颜色改为从legend取颜色
Browse files Browse the repository at this point in the history
  • Loading branch information
pissang committed Jan 13, 2014
1 parent ae17b2f commit c363936
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/chart/force.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ define(function(require) {

var NDArray = require('../util/ndarray');

var legend;
var self = this;
self.type = ecConfig.CHART_TYPE_FORCE;

Expand Down Expand Up @@ -98,7 +99,7 @@ define(function(require) {
var mouseX, mouseY;

function _buildShape() {
var legend = component.legend;
legend = component.legend;
temperature = 1.0;
viewportWidth = zr.getWidth();
viewportHeight = zr.getHeight();
Expand Down Expand Up @@ -321,6 +322,7 @@ define(function(require) {
if (typeof(node.category) !== 'undefined') {
var category = categories[node.category];
if (category) {
shape.style.color = legend.getColor(category.name);
var style = category.itemStyle;
if (style) {
if (style.normal) {
Expand Down

0 comments on commit c363936

Please sign in to comment.