GithubHelp home page GithubHelp logo

Comments (7)

Pluto-Y avatar Pluto-Y commented on June 11, 2024

@hjqiaho 你可以显示的时候通过formatter来进行调整

from ios-echarts.

hjqiaho avatar hjqiaho commented on June 11, 2024

@Pluto-Y 是像这样吗 具体formatter的值怎么写呢
NSMutableDictionary *trigger = [NSMutableDictionary dictionary];
[trigger setObject:@"axis" forKey:@"trigger"];
[trigger setObject:@"{b}
{a0}:{c0}" forKey:@"formatter"];

NSDictionary *radar = @{
                        @"legend":legend,
                        @"polar":polararray,
                        @"series":seriesarray,
                        @"tooltip":trigger,
                        @"title":[NSDictionary dictionaryWithObject:@"各科能力雷达图" forKey:@"text"]

from ios-echarts.

Pluto-Y avatar Pluto-Y commented on June 11, 2024

你用的是哪一个版本你的iOS-Echarts,你用radar来设置option吗?还是怎么样?能贴一些关于你option的代码吗

from ios-echarts.

hjqiaho avatar hjqiaho commented on June 11, 2024

NSArray *templist = list[@"list"];
NSMutableArray *indicatortemp = [NSMutableArray array];
NSMutableArray *radarvalue = [NSMutableArray array];
for (int i = 0; i<templist.count; i++) {
NSDictionary *tempblank = @{@"max":@(-10),@"min":@(0),@"text":templist[i][@"blankName"]};
NSInteger rank = [[NSString stringWithFormat:@"%@",templist[i][@"rank"]] integerValue];
[indicatortemp addObject:tempblank];
[radarvalue addObject:@(-rank)];
}
NSArray *legenddata = @[@"学科排名"];
NSDictionary *legend = [NSDictionary dictionaryWithObjectsAndKeys:@"vertical",@"orient",@"right",@"x",@"bottom",@"y",legenddata,@"data",nil];
NSArray *polararray = @[ @{@"radius": @"80%",@"indicator":indicatortemp,@"scale":@(YES)},];
NSArray *seriesarray = @[@{@"name": @"各学科排名",@"sort":@"descending",@"type": @"radar",@"data":@[
@{@"name":@"学科排名",
@"value":radarvalue}
]}
];
NSMutableDictionary *trigger = [NSMutableDictionary dictionary];
[trigger setObject:@"axis" forKey:@"trigger"];
[trigger setObject:@"{b}
{c}:{c0}" forKey:@"formatter"];

NSDictionary *radar = @{
                        @"legend":legend,
                        @"polar":polararray,
                        @"series":seriesarray,
                        @"tooltip":trigger,
                        @"title":[NSDictionary dictionaryWithObject:@"各科能力雷达图" forKey:@"text"]
                        
                        };
PYOption *option = [RMMapper objectWithClass:[PYOption class] fromDictionary:radar];
[_kEchartView setOption:option];
[_kEchartView loadEcharts];

就是这段代码 版本就是前几天在这个git下载的

from ios-echarts.

Pluto-Y avatar Pluto-Y commented on June 11, 2024

@hjqiaho 可以修改这下面的,应该是c0或者c前面加一个负号试试,建议使用原声属性来进行设置,你这种方式如果设置了多余的属性是不会有提示的,具体的demo看github上的demo

[trigger setObject:@"{b}{c}:{c0}" forKey:@"formatter"];

from ios-echarts.

hjqiaho avatar hjqiaho commented on June 11, 2024

加上负号就不返回数值或文字了 直接显示 {-c}
有没有直接倒序显示的方法?

from ios-echarts.

hjqiaho avatar hjqiaho commented on June 11, 2024
[label setObject:@"(function(params) {return -params.value;})" forKey:@"formatter"];

这么写解决了

from ios-echarts.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.