我正在构建一个可以包含多达5种不同类型数据系列的高清图.我将类似的系列放在一起,因此不同的系列会有3个不同的y轴.
我遇到的问题是,我不能改变的工具提示为系列说的一个On或Off如果值为100或0.
目前我使用的是共享工具提示,但每个数据系列都有自己的工具提示.5的4只使用前缀/后缀上工具提示,前%,amps,psig等.
不幸的是,我无法通过将工具提示更改为On或Off来使其工作.这是我尝试过的.
dataSeries.push({
name: currData['name'],
type: 'line', // Type of visual display
width: 0.4,
yAxis: currData['yAxis'],
data: currData['series'],
tooltip: {
pointFormat: '{series.marker} {series.name}: ' + ('{value}' == 100 ? '<b>On</b><br />' : '<b>Off</b><br />')
//valueSuffix: '{value}' === 100 ? 'On' : 'Off'
formatter: function () {
// Cant get any of these to work
return '{value}' == 100 ? 'On' : 'Off';
return this.y …Run Code Online (Sandbox Code Playgroud) 我只想要第一个元素s.split(","),我需要将值返回到String数组中.
如何将此代码设为一个班轮?
String [] sd = s.split(",");
String [] sf = new String[]{sd[0]};
Run Code Online (Sandbox Code Playgroud)
我试过s.split(",",1);但它只是将它全部添加到第一个元素而不实际拆分它.
如果我的桌子是这样的
CREATE TABLE public.temperatures (
temperature_io_id integer NOT NULL,
temperature_station_id integer NOT NULL,
temperature_value double precision NOT NULL,
temperature_current_kw double precision NOT NULL,
temperature_value_added integer DEFAULT 1,
temperature_kw_year_1 double precision DEFAULT 0,
/* Keys */
CONSTRAINT temperatures_pkey
PRIMARY KEY (temperature_io_id, temperature_station_id, temperature_value)
) WITH (
OIDS = FALSE
);
Run Code Online (Sandbox Code Playgroud)
当存在io_id,station_id和温度的唯一组合时,我试图将值添加到表中。如果此组合已经存在,我想更新kw值并将1添加到value_added字段中。这将用于在该温度下保持kw的运行平均值。
INSERT INTO temperatures
(temperature_io_id, temperature_station_id, temperature_value, temperature_curr_kw)
VALUES
(20,30,40,10)
ON CONFLICT
(temperature_io_id, temperature_station_id, temperature_value)
DO UPDATE SET
temperature_current_kwh = ((temperature_current_kw * temperature_value_added) + EXCLUDED.temperature_current_kw) / (temperature_value_added + 1),
temperature_value_added = …Run Code Online (Sandbox Code Playgroud) arrays ×1
highcharts ×1
java ×1
javascript ×1
jquery ×1
postgresql ×1
sql ×1
string ×1
unique ×1
upsert ×1