Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.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
Javascript 将maxDataPoints放入grafana数据源中_Javascript_Dashboard_Grafana - Fatal编程技术网

Javascript 将maxDataPoints放入grafana数据源中

Javascript 将maxDataPoints放入grafana数据源中,javascript,dashboard,grafana,Javascript,Dashboard,Grafana,我正在使用grafana 5.1.4。我构建了一个自定义数据源。但是属性maxDataPoints no在datasource配置中显示 这是我的文件结构: query.options.html中的我的代码: <section class="grafana-metric-options"> <div class="gf-form"> </div> <div class="gf-form-inline"> <div class="gf

我正在使用grafana 5.1.4。我构建了一个自定义数据源。但是属性maxDataPoints no在datasource配置中显示

这是我的文件结构:

query.options.html中的我的代码:

<section class="grafana-metric-options">
<div class="gf-form">
</div>
<div class="gf-form-inline">
    <div class="gf-form max-width-15">
        <span class="gf-form-label">Max data points</span>
        <input type="text"
               class="gf-form-input"
               ng-model="ctrl.panelCtrl.panel.maxDataPoints"
               bs-tooltip="'Override max data points, automatically set to graph width in pixels.'"
               data-placement="right"
               ng-model-onblur ng-change="ctrl.panelCtrl.refresh()"
               spellcheck='false'
               placeholder="auto">
        </input>
    </div>
</div>

Q:我可以访问
plugin.json
的属性值吗?如果是,我如何从控制器访问
maxDataPoints
属性

A:您只能访问
plugin.json
中的部分属性值。这些值可以在
PluginMeta
类中找到,它的一个实例可以在
Datasource
类的
instanceSettings.meta
变量中找到

不幸的是,
maxDataPoints
属性不是您可以访问的属性之一

如果您有一个有效的
用例
,您可以尝试输入一个pull请求,请求Grafana团队为您公开它

这个e决定从所有
plugin.json
向客户端提供什么。是的,如果要公开
maxDataPoint
属性,则必须扩展该代码

"queryOptions": {
   "maxDataPoints": true
}