小编Pre*_*thy的帖子

如何禁用chartjs legendclick

我想禁用chart.js蜘蛛图表图例点击,因为当我点击图例时,数据系列隐藏了相关的值集,如下图所示.

在此输入图像描述

在此输入图像描述

我的要求是我不想禁用数据集.我试过了preventDefault(); 在图表上单击但它不起作用.

我的代码示例附在下面.请检查..

<!doctype html>
<html>

<head>
    <title>Radar Chart</title>
    <script src="../dist/Chart.bundle.js"></script>
    <script src="http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>
</head>

<body>
    <div style="width:75%">
        <canvas id="canvas"></canvas>
    </div>
    <script>
    var randomScalingFactor = function() {
        return Math.round(Math.random() * 100);
    };
    var randomColorFactor = function() {
        return Math.round(Math.random() * 255);
    };
    var randomColor = function(opacity) {
        return 'rgba(' + randomColorFactor() + ',' + randomColorFactor() + ',' + randomColorFactor() + ',' + (opacity || '.3') + ')';
    };

    var config = {
        type: 'radar',
        data: {
            labels: ["Eating", "Drinking", "Sleeping", …
Run Code Online (Sandbox Code Playgroud)

javascript jquery chart.js

18
推荐指数
4
解决办法
2万
查看次数

Google柱形图自定义图例

我想自定义我的柱形图API,如下所示

1)当我单击图例时,与其关联的数据集应返回null并以禁用的颜色显示图例.我的代码如下.

function drawVisualization() {
    // Create and populate the data table.
    var chart_div       =   document.getElementById('visualization2');

    var data2           =   google.visualization.arrayToDataTable([["Sections","Client Scored",{ role: "style" },"Client Confidence",{ role: "style" },"Average Mark",{ role: "style" },"Average Confidence",{ role: "style" }],["Set 1",90,"opacity: 1",95,"opacity: 0.5",78,"opacity: 1",69,"opacity: 0.5"],["Set 2",65,"opacity: 1",73,"opacity: 0.5",99,"opacity: 1",99,"opacity: 0.5"]]);  
    var options = {
      title:"Understanding",
      width:'100%', height:600,seriesType: "bars"
        ,series:{1: {type: "line",pointSize: 10,lineWidth :0},3: {type: "line",pointSize: 10,lineWidth :0}}
        ,colors: ['#fafe14','#fafe14','#05afed','#05afed']
      ,vAxis: {title: "%Score",format: '##', minValue: '1', maxValue: '8'},      
      hAxis: {title: "",slantedText: true,slantedTextAngle:60, maxTextLines: 5, maxAlternation: …
Run Code Online (Sandbox Code Playgroud)

google-visualization bar-chart legend-properties column-chart

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

Excel不支持泰语,越南语

我创建了一个excel,它有泰语和越南语.我的问题是它将这些字符显示为问号.

我的代码如下

$worksheet->write($i, 5, iconv("UTF-8", "ISO-8859-1//TRANSLIT", html_entity_decode($text)), $mainquest);
Run Code Online (Sandbox Code Playgroud)

我也尝试了所有其他ISO标准.我把ISO-8859-1用于法语支持.我也试过mb_convert_encoding但没有进展.

这有什么解决方案吗?

php excel character-encoding

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