Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

executable file 104 lines (76 sloc) 2.988 kB
/*
* Copyright 2007-2010 WorldWide Conferencing, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package net.liftweb {
package flot_demo {
package web {
package snippet {
import scala.xml.NodeSeq
import net.liftweb.common._
import net.liftweb.util._
import Helpers._
import net.liftweb.http.js.JsCmds._
import net.liftweb.widgets.flot._
/*
*
*/
class Time {
def render (xhtml: NodeSeq) = {
def graph () = {
var d1a : List [Pair [Double, Double]] =
(-373597200000.0, 315.71) :: (-370918800000.0, 317.45) :: Nil
var d1b : List [Pair [Double, Double]] =
(-247366800000.0, 319.69) :: (-244688400000.0, 320.58) :: Nil
var d2a : List [Pair [Double, Double]] =
(-123555600000.0, 321.59) :: (-121136400000.0, 322.39) :: Nil
var d2b : List [Pair [Double, Double]] =
(-2682000000.0, 324.12) :: (-3600000.0, 325.06) :: Nil
var d3a : List [Pair [Double, Double]] =
(113007600000.0, 329.31) :: (115686000000.0, 327.51) :: Nil
var d3b : List [Pair [Double, Double]] =
(236559600000.0, 334.73) :: (239238000000.0, 332.52) :: Nil
var d4a : List [Pair [Double, Double]] =
(352249200000.0, 341.57) :: (354924000000.0, 342.56) :: Nil
var d4b : List [Pair [Double, Double]] =
(478479600000.0, 347.49) :: (481154400000.0, 348.00) :: Nil
var d5a : List [Pair [Double, Double]] =
(594342000000.0, 350.04) :: (596934000000.0, 351.29) :: Nil
var d5b : List [Pair [Double, Double]] =
(715298400000.0, 352.79) :: (717894000000.0, 353.20) :: Nil
var d6a : List [Pair [Double, Double]] =
(830901600000.0, 364.94) :: (833580000000.0, 364.70) :: Nil
var d6b : List [Pair [Double, Double]] =
(951865200000.0, 370.38) :: (954540000000.0, 371.63) :: Nil
var d7a : List [Pair [Double, Double]] =
(1067641200000.0, 374.77) :: (1070233200000.0, 375.97) :: Nil
val s = new FlotSerie () {
override val data = d1a ::: d1b ::: d2a ::: d2b ::: d3a ::: d3b ::: d4a ::: d4b :::
d5a ::: d5b ::: d6a ::: d6b ::: d7a
}
val options = new FlotOptions () {
override val xaxis = Full (new FlotAxisOptions () {
override val mode = Full ("time")
})
}
Flot.render ( "ph_graph", s :: Nil, options, Flot.script(xhtml))
}
//
bind ("flot", xhtml, "graph" -> graph)
}
}
}
}
}
}
Jump to Line
Something went wrong with that request. Please try again.