Coder Social home page Coder Social logo

Comments (4)

jbkunst avatar jbkunst commented on June 27, 2024

Thanks. Let's see what's going on. If I have news I'll write you in this issue.

from highcharter.

jbkunst avatar jbkunst commented on June 27, 2024

@ziyadsaeed

I found this option in highcharts:

turboThreshold: NumberSince 2.2
When a series contains a data array that is longer than this, only one dimensional arrays of numbers, or two dimensional arrays with x and y values are allowed. Also, only the first point is tested, and the rest are assumed to be the same format. This saves expensive data checking and indexing in long series. Set it to 0 disable. Defaults to 1000.

To change this parameter you need to override the default value.

hcopts <- getOption("highcharter.options")
hcopts <- rlist::list.merge(
  hcopts,
  list(chart = list(
    plotOptions = list(
      series = list(
        turboThreshold = 0
      )
    )
  ))
)
options(highcharter.options = hcopts)

Then run your code

nyears <- 500

df <- expand.grid(seq(12) - 1, seq(nyears) - 1)
df$value <- abs(seq(nrow(df)) + 10 * rnorm(nrow(df))) + 10
df$value <- round(df$value, 2)

head(df)
tail(df)

nrow(df) == nyears*12

ds <- setNames(list.parse2(df), NULL)
head(ds)
tail(ds)

highchart() %>% 
  hc_chart(type = "heatmap") %>% 
  hc_title(text = "Simulated values by years and months") %>% 
  hc_xAxis(categories = month.abb) %>% 
  hc_yAxis(categories = 2016 - nyears + seq(nyears),
           showFirstLabel = FALSE,
           showLastLabel = FALSE) %>% 
  hc_add_serie(name = "value", data = ds) %>% 
  hc_colorAxis( minColor = "#FFFFFF", maxColor = "#434348")

Finally, I'll disable this threshold parameter in the next versión of highcharter.

Regards,

from highcharter.

ziyadsaeed avatar ziyadsaeed commented on June 27, 2024

Still has some display issues
image 1

from highcharter.

jbkunst avatar jbkunst commented on June 27, 2024

This are highcharts issues. The line at the top is a gridline. So add gridLineWidth = 0 in hc_yAxis options to remove that line. The first label dont show due the showFirstLabel option.

nyears <- 500

df <- expand.grid(seq(12) - 1, seq(nyears) - 1)
df$value <- abs(seq(nrow(df)) + 2000 * rnorm(nrow(df))) + 10
df$value <- round(df$value, 2)

head(df)
tail(df)

nrow(df) == nyears*12

ds <- setNames(list.parse2(df), NULL)
head(ds)
tail(ds)


fntltp <- JS("function(){
                  return this.series.xAxis.categories[this.point.x] + '<br>' +
             this.series.yAxis.categories[this.point.y] + '<br>' +
             Highcharts.numberFormat(this.point.value, 2);
             ; }")

highchart() %>% 
  hc_chart(type = "heatmap", zoomType = "xy") %>% 
  hc_title(text = "Simulated values by years and months") %>% 
  hc_xAxis(categories = month.abb) %>% 
  hc_yAxis(categories = 2016 - nyears + seq(nyears),
           gridLineWidth = 0,
           showFirstLabel = TRUE,
           showLastLabel = FALSE) %>% 
  hc_add_serie(name = "value", data = ds) %>% 
  hc_tooltip(formatter = fntltp) %>% 
  hc_colorAxis(minColor = "#434348", maxColor = "#000000")

from highcharter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.