iOS 使用Echarts 出现animation: false calculable:false急急急

alone23
  • 253

请求到了数据
(lldb) po stringX
552,512,389,310,287,264,237,213,165,132,67,58,54,46,21

(lldb) po stringY
"江阴华西化工码头有限公司","江苏三房巷国际储运有限公司化工品专用码头","江苏江阴港港口集团股份有限公司","江苏丽天石化码头有限公司","江阴澄利散装化工有限公司","中船澄西船舶修造有限公司修船码头","南荣石油化学有限公司化工码头","江苏利士德化工有限公司化工码头","江苏江阴港口集团股份有限公司大港分公司","江苏长宏国际港口有限公司","江阴奥德费尔嘉盛码头有限公司化工码头","中国石化化工销售有限公司江阴经营部化工码头
","12号锚地","中粮麦芽(江阴)有限公司","长江村"

for (GDataXMLElement *user in data) {

    
    NSString *tY = [[user attributeForName:@"DOCK_NAME"] stringValue];
    NSString *tX = [[user attributeForName:@"SHIPCOUNT"] stringValue];
    
    count = [[user attributeForName:@"PAGE_ITEM_COUNT"] stringValue];
    [dataListX addObject:tX];
    [dataListY addObject:tY];
}

NSMutableArray *dataListYY = [[NSMutableArray alloc]init];


NSString *stringX = @"";
NSString *stringY = @"";
for (int i = 0; i < dataListX.count; i++) {
    dataListYY[i] = [[@"\"" stringByAppendingString:dataListY[i]]stringByAppendingString:@"\""];
    stringX = [[stringX stringByAppendingString:dataListX[i]]stringByAppendingString:@","];
}
for (int i = 0; i < dataListX.count; i++) {
    stringY = [[stringY stringByAppendingString:dataListYY[i]]stringByAppendingString:@","];
}
NSRange rangerX = NSMakeRange(0, stringX.length - 1);


NSMutableString * muStr = [NSMutableString stringWithString:stringY];
while (1) {
    NSRange range = [muStr rangeOfString:@"\n"];
    
    if (range.location != NSNotFound)
    {
        NSInteger loc = range.location;

        [muStr deleteCharactersInRange:NSMakeRange(loc, 1 )];
    }
   
    else
    {
        break;
    }
}
stringY = [NSString stringWithString:muStr];
NSRange rangerY = NSMakeRange(0, stringY.length - 1);
stringX = [stringX substringWithRange:rangerX];
stringY = [stringY substringWithRange:rangerY];

// NSString *basicBarJson = [NSString stringWithFormat:@"{"grid":{"x":30,"x2":45},"title":{"text":"码头停靠船舶艘次图","subtext":"船舶艘次"},"tooltip":{"trigger":"axis"},"legend":{"data":["",""]},"toolbox":{"show":false,"feature":{"mark":{"show":false},"dataView":{"show":false,"readOnly":false},"magicType":{"show":false,"type":["line","bar"]},"restore":{"show":false},"saveAsImage":{"show":false}}},"calculable":false,"xAxis":[{"type":"value","boundaryGap":[0,0.01]}],"yAxis":[{"type":"category","data":[%@]}],"series":[{"type":"bar","data":[%@]}]}",stringY,stringX];
//
//
// NSData *jsonData = [basicBarJson dataUsingEncoding:NSUTF8StringEncoding];
// NSDictionary *jsonDic = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingAllowFragments error:nil];
// PYOption *option = [RMMapper objectWithClass:[PYOption class] fromDictionary:jsonDic];
// [_kEchartView setOption:option];


NSString *basicBarJson = [NSString stringWithFormat:@"{\"grid\":{\"x\":125,\"x2\":25},\"title\":{\"text\":\"码头停靠船舶艘次图\",\"subtext\":\"船舶艘次\"},\"tooltip\":{\"trigger\":\"axis\"},\"legend\":{\"data\":[\"\",\"\"]},\"toolbox\":{\"show\":false,\"feature\":{\"mark\":{\"show\":false},\"dataView\":{\"show\":false,\"readOnly\":false},\"magicType\":{\"show\":false,\"type\":[\"line\",\"bar\"]},\"restore\":{\"show\":false},\"saveAsImage\":{\"show\":false}}},\"calculable\":false,\"xAxis\":[{\"type\":\"value\",\"boundaryGap\":[0,0.01],\"axisLabel\":{\"show\":true,\"textStyle\":{\"fontSize\":6},\"interval\":\"auto\"}}],\"yAxis\":[{\"type\":\"category\",\"axisLabel\":{\"show\":true,\"textStyle\":{\"fontSize\":6},\"interval\":\"auto\"},\"splitLine\":{\"show\":true},\"data\":[%@]}],\"series\":[{\"type\":\"bar\",\"data\":[%@]}]}",stringY,stringX];

NSData *jsonData = [basicBarJson dataUsingEncoding:NSUTF8StringEncoding];
NSDictionary *jsonDic = [NSJSONSerialization JSONObjectWithData:jsonData options:NSJSONReadingAllowFragments error:nil];
PYOption *option = [RMMapper objectWithClass:[PYOption class] fromDictionary:jsonDic];
[_kEchartView setOption:option];
[_kEchartView loadEcharts];
[_kEchartView reload];

Echarts报animation: false renderAsImage:false calculable:false,加载不出,换成以前的SQL可以加载
回复
阅读 3.7k
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏