Skip to content
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

Add log axis for radar charts #11324

Merged
merged 3 commits into from
Oct 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,13 +204,13 @@ If you are a committer of apache/incubator-echarts project, which means you have
+ About adding the license/header of 3rd-party work:
+ https://www.apache.org/legal/src-headers.html#3party
+ Licenses that are compatible with the Apache license:
+ BSD and MIT are compatibal with the Apache license but CC_BY_SA is not (https://apache.org/legal/resolved.html#cc-sa).
+ BSD and MIT are compatible with the Apache license but CC_BY_SA is not (https://apache.org/legal/resolved.html#cc-sa).
+ Stack overflow:
+ before intending to copy code from Stack overlow, we must check:
+ https://apache.org/legal/resolved.html#stackoverflow
+ https://issues.apache.org/jira/browse/LEGAL-471
+ Wikipedia:
+ Wikipedia is licensed CC 4.0 BY_SA and is compatible with the Apache license. So we should not copy code from Wikipedia.
+ Wikipedia is licensed CC 4.0 BY_SA and is incompatible with the Apache license. So we should not copy code from Wikipedia.
+ Working in progress disclaimer:
+ In some cases we might use the work in progress disclaimer and document the issues in that until they are fixed.
+ https://incubator.apache.org/policy/incubation.html#disclaimers
4 changes: 3 additions & 1 deletion src/coord/radar/Radar.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
niceScaleExtent
} from '../axisHelper';
import CoordinateSystem from '../../CoordinateSystem';
import LogScale from '../../scale/Log';

function Radar(radarModel, ecModel, api) {

Expand All @@ -40,7 +41,8 @@ function Radar(radarModel, ecModel, api) {

this._indicatorAxes = zrUtil.map(radarModel.getIndicatorModels(), function (indicatorModel, idx) {
var dim = 'indicator_' + idx;
var indicatorAxis = new IndicatorAxis(dim, new IntervalScale());
var indicatorAxis = new IndicatorAxis(dim,
(indicatorModel.get('axisType') === 'log') ? new LogScale() : new IntervalScale());
indicatorAxis.name = indicatorModel.get('name');
// Inject model and axis
indicatorAxis.model = indicatorModel;
Expand Down
5 changes: 4 additions & 1 deletion src/coord/radar/RadarModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ var RadarModel = echarts.extendComponentModel({
var scale = this.get('scale');
var axisLine = this.get('axisLine');
var axisTick = this.get('axisTick');
var axisType = this.get('axisType');
var axisLabel = this.get('axisLabel');
var nameTextStyle = this.get('name');
var showName = this.get('name.show');
Expand All @@ -67,8 +68,9 @@ var RadarModel = echarts.extendComponentModel({
scale: scale,
axisLine: axisLine,
axisTick: axisTick,
axisType,
axisLabel: axisLabel,
// Competitable with 2 and use text
// Compatible with 2 and use text
name: indicatorOpt.text,
nameLocation: 'end',
nameGap: nameGap,
Expand Down Expand Up @@ -144,6 +146,7 @@ var RadarModel = echarts.extendComponentModel({
),
axisLabel: defaultsShow(valueAxisDefault.axisLabel, false),
axisTick: defaultsShow(valueAxisDefault.axisTick, false),
axisType: 'interval',
splitLine: defaultsShow(valueAxisDefault.splitLine, true),
splitArea: defaultsShow(valueAxisDefault.splitArea, true),

Expand Down