Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jquery 如何在FLOT中的图例项之间添加空格?_Jquery_Html_Flot - Fatal编程技术网

Jquery 如何在FLOT中的图例项之间添加空格?

Jquery 如何在FLOT中的图例项之间添加空格?,jquery,html,flot,Jquery,Html,Flot,我有下图,我想在图例项之间添加空格。我尝试在传递给标签的字符串中添加空格,但没有成功。有什么想法吗?短暂性脑缺血发作 code $(document).ready(function() { $.plot($("#NR"), NRLine, { grid: { backgroundColor: "#E5E5E5", hoverable: true

我有下图,我想在图例项之间添加空格。我尝试在传递给标签的字符串中添加空格,但没有成功。有什么想法吗?短暂性脑缺血发作

code

       $(document).ready(function() {
            $.plot($("#NR"), NRLine,  {
                grid: {
                    backgroundColor: "#E5E5E5",
                    hoverable: true
                },
                xaxis: {
                    mode: "time",
                    timeformat: "%m/%d",
                    minTickSize: [7, "day"],
                    ticks: datearray


                        },
                        legend: {


                        noColumns: 4,
                        container: $("#chartLegend")} 


    }
     );
        });     

code

能否提供您的代码片段?在我看来,这可能是你需要的解决方案。使用labelFormatter强制按您需要的方式进行设置。

图例标签位于带有类
legendLabel
的容器中,因此您只需根据需要定义CSS即可。将其放入您的页面
标签:

       $(document).ready(function() {
            $.plot($("#NR"), NRLine,  {
                grid: {
                    backgroundColor: "#E5E5E5",
                    hoverable: true
                },
                xaxis: {
                    mode: "time",
                    timeformat: "%m/%d",
                    minTickSize: [7, "day"],
                    ticks: datearray


                        },
                        legend: {


                        noColumns: 4,
                        container: $("#chartLegend")} 


    }
     );
        });     
<style>
  #chartLegend .legendLabel { padding-right:10px; }​
</style>

#chartLegend.legendLabel{padding right:10px;}​

看起来是这样的:

@Ryley的答案很好。如果您想对每个标签进行多一点控制,可以放置:

标签:“foo”

我不确定标签格式化程序如何实现这一点-您能提供一个间距示例吗?