org.datacleaner.visualization.StackedAreaAnalyzerChartScriptHeadElement.scala Maven / Gradle / Ivy
package org.datacleaner.visualization
import java.util.Date
import org.datacleaner.result.html.{HeadElement, HtmlRenderingContext}
import scala.collection.JavaConverters._
class StackedAreaAnalyzerChartScriptHeadElement(result: IStackedAreaAnalyzerResult, elementId: String) extends HeadElement {
override def toHtml(context: HtmlRenderingContext): String = {
val html = new StringBuilder
html.append("""
""");
return html.toString
}
def toNumber(x: Any): Number = {
if (x.isInstanceOf[Number]) {
return x.asInstanceOf[Number]
}
if (x.isInstanceOf[Date]) {
return x.asInstanceOf[Date].getTime()
}
throw new UnsupportedOperationException("Encountered unexpected non-number: " + x)
}
}