Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Google Gantt charts stopped working #103

Open
vanhob opened this issue Apr 24, 2016 · 2 comments
Open

Google Gantt charts stopped working #103

vanhob opened this issue Apr 24, 2016 · 2 comments

Comments

@vanhob
Copy link

vanhob commented Apr 24, 2016

hi, it seems the gantt charts stopped working over the past couple of days/weeks? As Gantt charts are still in beta at Google, did they change the API? :

Here is my ruby code with the view definition:

def party_life_gantt_charts

data_table = GoogleVisualr::DataTable.new
counter = 0
data_table.new_column('string', 'Period ID')
data_table.new_column('string', 'Period')
data_table.new_column('string', 'Resource')
data_table.new_column('date'  , 'Start Date')
data_table.new_column('date'  , 'End Date')
data_table.new_column('number', 'Duration')
data_table.new_column('number', 'Percent Complete')
data_table.new_column('string', 'Dependencies')

@party.periods.each do |line|
  start_date = line.effective_start_date
  end_date = line.effective_end_date
  if start_date != nil and end_date != nil then
    if end_date <= Date.today then
      completed = 100
    else
      if start_date >= Date.today then
        completed = 0
      else
        completed = (100 * TimeDifference.between(Date.today, start_date).in_days/TimeDifference.between(start_date, end_date).in_days).to_i
      end
    end
    duration = [30, TimeDifference.between(end_date, start_date).in_days*(1.0)].max.to_i
    data_table.add_rows([[line.id.to_s,line.period_name, look_up_value(line.period_type), start_date, nil, days_to_milli(duration), completed , nil]])
    counter += 1
  end
end

opts   = { version: '1.1', height: 25 + counter * 50}
@periods_chart = GoogleVisualr::Interactive::GanttChart.new(data_table, opts)

end

@winston
Copy link
Owner

winston commented Apr 25, 2016

There's an open PR for it. #102

Sorry have been slightly busy. Will take a look in the next few days.

@francesco-loreti
Copy link

any news???

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants