All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.gatling.highcharts.template.GroupDetailsDurationDistributionTemplate.scala Maven / Gradle / Ivy

There is a newer version: 3.13.1
Show newest version
/**
 * Copyright 2011-2016 GatlingCorp (http://gatling.io)
 *
 * Licensed under the Gatling Highcharts License
 */
package io.gatling.highcharts.template

import com.dongxiguo.fastring.Fastring.Implicits._

import io.gatling.highcharts.series.StackedColumnSeries

class GroupDetailsDurationDistributionTemplate(title: String, containerId: String, durationSeriesSuccess: StackedColumnSeries, durationSeriesFailure: StackedColumnSeries) extends Template {

  def js = fast"""
var responseTimeDistributionChart = new Highcharts.Chart({
  chart: {
    renderTo: '$containerId',
    type: 'column'
  },
  credits: { enabled: false },
  legend: {
    enabled: true,
    floating: true,
    y: -285,
    borderWidth: 0,
    itemStyle: { fontWeight: "normal" }
  },
  title: { text: 'A title to let highcharts reserve the place for the title set later' },
  xAxis: {
    categories: ['${durationSeriesSuccess.getXValues.mkFastring("', '")}'],
    tickInterval: 20
  },
  yAxis: {
    min: 0,
    title: { text: 'Percentage of Requests' }
  },
  tooltip: {
    formatter: function() {
      return ''+ this.x +' ms
'+ this.series.name +': '+ this.y +' %
'+ 'Total: '+ this.point.stackTotal + ' %'; } }, plotOptions: { series: { groupPadding: 0, stacking: 'normal', shadow: true } }, series: [ {${renderStackedColumnSeries(durationSeriesSuccess)}}, {${renderStackedColumnSeries(durationSeriesFailure)}} ] }); responseTimeDistributionChart.setTitle({ text: '$title', useHTML: true }); """ val html = fast"""
""" }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy