eljamz

Grid Background Color On Specific Date (Yaxis)

Recommended Posts

I' trying to get some different background color so it can display the time you dont have to use a lot of electricity in red and gree for the less cost hours...

 

is there any way to do this ?

Share this post


Link to post
Share on other sites

I cant make it work...

 

 

I'm tryin to add the vLines with the categories and the categories are "DATE" fields like: 2011-01-12 11:02:50

 

so for test i write this code:

 

<vTrendLines>

<line startValue='2011-01-10 11:02:50' endValue='2011-01-12 11:02:50' color='FF0000' displayValue='Zone 1' isTrendZone='1'displayValue='More cost day' />

</vTrendLines>

 

But it doesnt display anything.

 

any help ?

Share this post


Link to post
Share on other sites
Guest Angie

Hi,

 

We are looking into the issue and will get back to you soon.

 

Could you please send us the code to replicate the issue from our end?

 

Awaiting for your reply.

Edited by Angie

Share this post


Link to post
Share on other sites

Hi,

 

We are looking into the issue and will get back to you soon.

 

Could you please send us the code to replicate the issue from our end?

 

Awaiting for your reply.

 

 

 

//Now, we need to convert this data into multi-series XML. 
  //We convert using string concatenation.
  // $strXML - Stores the entire XML
  // $strDates - Stores XML for the <categories> and child <category> elements
  // $strDataTri and $strDataFases - For the data

          //Initialize <chart> element
	   $strXML = "<chart labelStep='5' btnResetChartTitle='Estado Original' btnSwitchToPinModeTitle='Modo de Seleccion' btnSwitchToZoomModeTooltext='Modo de Zoom' btnSwitchToPinModeTooltext='Modo de Seleccion' numberPrefix='' caption='". $caption ."' subCaption='Ginequito' xAxisName='". $xAxisName ."' yAxisName='". $yAxisName ."'>";

          //Initialize <categories> element - necessary to generate a multi-series chart
          $strDates = "<categories>";

          //Initiate <dataset> elements
	   if ($dataPost == "Voltaje" || $dataPost == "Corriente") {
			$strDataFase1 = "<dataset seriesName='Fase 1'>";
			$strDataFase2 = "<dataset seriesName='Fase 2'>";
			$strDataFase3 = "<dataset seriesName='Fase 3'>";
	   } else {
			$strDataTri = "<dataset seriesName='Trifasico'>";
	   }

          //Iterate through the data
          foreach ($dateData as $dateSubData) {

          //Append <category name='...' /> to strDates
          $strDates .= "<category name='" . $dateSubData[date] . "' />";
	   }

          //Add <set value='...' /> tothe datasest
		   foreach ($arrData as $arSubData) {
			   if ($dataPost == "Voltaje") {
					   $strDataFase1 .= "<set value='" . ($arSubData[$fase1] / 10) . "' />";
					   $strDataFase2 .= "<set value='" . ($arSubData[$fase2] / 10) . "' />";
					   $strDataFase3 .= "<set value='" . ($arSubData[$fase3] / 10) . "' />";
			   } elseif ($dataPost == "Corriente") {
					   $strDataFase1 .= "<set value='" . ($arSubData[$fase1] / 1000) . "' />";
					   $strDataFase2 .= "<set value='" . ($arSubData[$fase2] / 1000) . "' />";
					   $strDataFase3 .= "<set value='" . ($arSubData[$fase3] / 1000) . "' />";
			   } elseif ($dataPost == "KwTrifasicos") {	 
					   $strDataTri .= "<set value='" . ($arSubData[$dataPostarr] / 1000) . "' />";
			   } elseif ($dataPost == "KvaTrifasicos") {	 
					   $strDataTri .= "<set value='" . ($arSubData[$dataPostarr] / 1000) . "' />";
			   } else {
					   $strDataTri .= "<set value='" . ($arSubData[$dataPostarr] / 100) . "' />";
			   }
		   }

          //Close <categories> element
          $strDates .= "</categories>";

	   //$strZones .= "<vTrendLines><line startValue='2011-01-10 11:02:50' endValue='2011-01-12 11:02:51' color='FF0000' displayValue='Zone 1' isTrendZone='1' displayValue='Horario de punta' /></vTrendLines><trendLines><line startValue='30' color='FF0000' displayValue='Promedio' /></trendLines>";

	   //Close <dataset> elements
	   if ($dataPost == "Voltaje" || $dataPost == "Corriente") {
			$strDataFase1 .= "</dataset>";
			$strDataFase2 .= "</dataset>";
			$strDataFase3 .= "</dataset>";
	   } else {
		    $strDataTri .= "</dataset>";
	   }

          //Assemble the entire XML now
	   if ($dataPost == "Voltaje" || $dataPost == "Corriente") {
			$strXML .= $strDates . $strDataFase1 . $strDataFase2 . $strDataFase3 . "</chart>";
	   } else {
		    $strXML .= $strDates . $strDataTri . "</chart>";
	   }


	   ?>

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now