簡體   English   中英

圖表:圖例和字體

[英]Flot chart: legend and font

我已經使用jQuery Flot庫配置了條形圖。 這是代碼:

<style>
.flot-chart-bar {
    height: 300px;
}
.flc-bar {
    font-size: 2px;
    border: 1px grey solid;

}

<div class="card profilestats" style="color: #fff !important;">
<div class="card-content" style="background-color: #bdbdbd !important;min-height:320px;">

    <div id="bar-tipoReclamo" class="flot-chart-bar"></div>
    <br>
    <div class="flc-bar" style="background-color: white; "></div>                        

</div>  
<div class="card-action" style="background-color: #757575 !important;;">
    <span>Distribuzione Tipi di Reclamo negli ultimi 3 anni</span>
</div>

這是酒吧:

        $.plot($("#bar-tipoReclamo"), barData, {
                series: {
                    bars: {
                        show: true,
                        barWidth: 0.13,
                        order: 1
                    }
                },
                valueLabels: {
                    show: true
                },
                xaxis: {
                     ticks: [[0,currentYear-2],[1,currentYear-1],[2,currentYear]]
                },
                legend: {
                    container: '.flc-bar',
                    noColumns: 0,
                    backgroundColor: "white",
                    lineWidth: 0
                },
                grid: {
                    hoverable: true,
                    clickable: true
                },
                tooltip: true,
                tooltipOpts: {
                 content: " %y,%s  " ,
                    shifts: {
                        x: 20,
                        y: 0
                    },
                    defaultTheme: false
                }
            });

現在的問題非常簡單:如何減小圖例中單詞的字體大小? 我已經嘗試使用CSS並使用一些我在網上找到的Legend屬性,但似乎沒有任何效果。

傳奇酒吧

我想減少欄下白色圖例中單詞的字體。

您擁有的CSS應該可以使用,但是font-size: 2px; 可能不是您想要的。 有關基於代碼的完整示例,請參見此小提琴 ,其中CSS中指定了font-size。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM