小编joo*_*ost的帖子

谷歌堆积条形图颜色

如何更改堆积条形图中列的颜色?如果我在MakeBarChart函数中指定colors属性,它只接受第一个参数.并使其他列成为该颜色的较轻版本.这就是它的样子;

图片

这就是代码;

function MakeBarChart(tmpData)
{	
	var barArray = [];
	barArray.push(['', 'Open', 'Wachten', 'Opgelost']);
	  for (key in tmpData) {
		  if (tmpData.hasOwnProperty(key)) {
			barArray.push(['Week' + key, tmpData[key]['active'], tmpData[key]['waiting'], tmpData[key]['closed']])
		  }
	  }

	var data = google.visualization.arrayToDataTable(
		barArray
	);
	
	var options = {
		chart: {
		title: 'Incidenten per week',
		subtitle: '',
	    'width':450,
	    'height':300,
    },
    bars: 'vertical', // Required for Material Bar Charts.
		'backgroundColor':{ fill:'transparent' },
		isStacked: true,
		colors:['#000','#1111','#55555']
	};

	var chart = new google.charts.Bar(document.getElementById('barchart_material'));
	chart.draw(data, google.charts.Bar.convertOptions(options));
}
Run Code Online (Sandbox Code Playgroud)

如何使列都有自己独立的颜色.

html javascript google-visualization

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

在查询中稍后使用'AS ColumnName'的值

我正在制作一个存储过程,我需要使用之前设置的值.我很难解释这个,所以我将使用一个例子:

  CASE 
     WHEN ((select top 1 stuksweergeven from componenten
            where componentid = componentlink.componentid) = 1) and
          ((select opbrengstperkilo from componenten
            where componentid = componentlink.componentid) <> 0) THEN 
        amount1 * (select opbrengstperkilo from componenten
                   where componentid = componentlink.componentid)
     ELSE 
        amount1
  END AS Total,
Amount1 * Total *(SELECT dbo.SelectReceptenLinkGewicht(Componentid,0)) AS TotalWeight
Run Code Online (Sandbox Code Playgroud)

我做了一个CASE给它结果为Total.之后我想使用Total来计算TotalWeight.

对不起我的英语不好.

sql sql-server stored-procedures

4
推荐指数
1
解决办法
79
查看次数

调用具有其他值作为参数的函数时,是否会覆盖函数的默认参数?

我在Delphi中创建一个需要特定值作为参数的函数,除非在调用函数时设置它.虽然在这种情况下会覆盖默认参数?

例:

function ExampleFunction(b = 3, a){
  b*a = c
}
Run Code Online (Sandbox Code Playgroud)
ExampleFunction(15,2)
Run Code Online (Sandbox Code Playgroud)

是否将默认参数(3)替换为给定参数(15)?

delphi parameters

-1
推荐指数
1
解决办法
78
查看次数