小编Son*_*y G的帖子

删除chart.js中的x轴标签/文本

如何隐藏chart.js中显示的x轴标签/文本?

设置scaleShowLabels:false仅删除y轴标签.

<script>
    var options = {
        scaleFontColor: "#fa0",
        datasetStrokeWidth: 1,
        scaleShowLabels : false,
        animation : false,
        bezierCurve : true,
        scaleStartValue: 0,
    };
    var lineChartData = {
        labels : ["1","2","3","4","5","6","7"],
        datasets : [
            {
                fillColor : "rgba(151,187,205,0.5)",
                strokeColor : "rgba(151,187,205,1)",
                pointColor : "rgba(151,187,205,1)",
                pointStrokeColor : "#fff",
                data : [1,3,0,0,6,2,10]
            }
        ]

    }

var myLine = new Chart(document.getElementById("canvas").getContext("2d")).Line(lineChartData,options);

</script>
Run Code Online (Sandbox Code Playgroud)

javascript charts html5 chart.js

53
推荐指数
7
解决办法
9万
查看次数

ibtoold(2546,0x11208c000)malloc:***auto malloc [2546]:错误

自从我升级到OSX 10.9 Mavericks以来,我一直在收到这个错误.谁能告诉我发生了什么?该应用程序不会崩溃但我每次编译时都会遇到这个恼人的错误.有没有办法来解决这个问题?

ibtoold(2546,0x11208c000) malloc: *** auto malloc[2546]: error: GC operation on unregistered thread. Thread registered implicitly. Break on auto_zone_thread_registration_error() to debug.Command /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ibtool emitted errors but did not return a nonzero exit code to indicate failure


/ibtoold(2546,0x11208c000) malloc: GC operation on unregistered thread. Thread registered implicitly. Break on auto_zone_thread_registration_error() to debug.


Command /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/ibtool emitted errors but did not return a nonzero exit code to indicate failure
Run Code Online (Sandbox Code Playgroud)

compiler-errors osx-mavericks xcode4.6.3

5
推荐指数
1
解决办法
1464
查看次数

如何将唯一对象添加到 nmutablearray?

我有一个带有 NSStrings 的 NSObject。如何仅将具有唯一 obj.name 的对象添加到 NSMutableArray?我试过 NSOrderedSet 但它只有在你将 NSString 添加到数组而不是包含 NSString 的对象时才有效。

例子。

@@interface MyObject : NSObject
@property (strong, nonatomic) NSString *name;
@end


NSMutableArray *array = {MyObject.name,MyObject.name,MyObject.name};
Run Code Online (Sandbox Code Playgroud)

如何确保没有两个 MyObject 具有相同的名称?

unique filter nsmutablearray ios nsorderedset

3
推荐指数
1
解决办法
1619
查看次数

drawInRect:withFont:iOS 7无效

我使用的是一个库(SGInfoAlert),它使用了弃用的代码drawInRect:r withFont:.我尝试更改一些代码以在iOS 7中修复它,但文本没有显示.谁知道为什么会这样?

// Changed this
//[info_ drawInRect:r withFont:[UIFont systemFontOfSize:kSGInfoAlert_fontSize]];

// To this
NSDictionary *textAttributes = @{NSFontAttributeName: [UIFont systemFontOfSize:kSGInfoAlert_fontSize]};

[info_ drawInRect:r withAttributes:textAttributes];
Run Code Online (Sandbox Code Playgroud)

这是git存储库https://github.com/sagiwei/SGInfoAlert

deprecated ios7 drawinrect

1
推荐指数
1
解决办法
2421
查看次数