This repository has been archived by the owner on Apr 12, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: kosmas58 <kosmas.schuetz@gmx.com>
- Loading branch information
Showing
44 changed files
with
2,403 additions
and
1,331 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
class Ui::Widgets::SelectmenuController < ApplicationController | ||
protect_from_forgery | ||
|
||
layout 'application' , :except => [ :get_data ] | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
app/views/graphics/highcharts/_tmp/highstock/_stock_area.js.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
!!! | ||
%html | ||
%head | ||
%meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"} | ||
%title Highstock Example | ||
%script{:src => "http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", :type => "text/javascript"} | ||
:javascript | ||
$(function() { | ||
$.get('data.csv', function(csv, state, xhr) { | ||
|
||
// inconsistency | ||
if (typeof csv != 'string') { | ||
csv = xhr.responseText; | ||
} | ||
|
||
// parse the CSV data | ||
var data = [], header, comment = /^#/, x; | ||
|
||
$.each(csv.split('\n'), function(i, line){ | ||
if (!comment.test(line)) { | ||
if (!header) { | ||
header = line; | ||
} | ||
else { | ||
var point = line.split(';'), | ||
date = point[0].split('-'); | ||
|
||
if (point.length > 1) { | ||
x = Date.UTC(date[2], date[1] - 1, date[0]); | ||
|
||
data.push([ | ||
x, // time | ||
parseFloat(point[4]) // close | ||
]); | ||
} | ||
} | ||
} | ||
}); | ||
|
||
// Create the chart | ||
window.chart = new Highcharts.StockChart({ | ||
chart: { | ||
renderTo: 'container' | ||
}, | ||
|
||
rangeSelector: { | ||
selected: 1 | ||
}, | ||
|
||
title: { | ||
text: 'USD to EUR exchange rate' | ||
}, | ||
|
||
xAxis: { | ||
maxZoom: 14 * 24 * 3600000 // fourteen days | ||
}, | ||
yAxis: { | ||
title: { | ||
text: 'Exchange rate' | ||
} | ||
}, | ||
|
||
series: [{ | ||
name: 'USD to EUR', | ||
data: data, | ||
type: 'area', | ||
threshold: null | ||
}] | ||
}); | ||
}); | ||
}); | ||
%body | ||
%script{:src => "../../js/highstock.js", :type => "text/javascript"} | ||
#container{:style => "height: 500px"} |
75 changes: 75 additions & 0 deletions
75
app/views/graphics/highcharts/_tmp/highstock/_stock_areaspline.js.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
!!! | ||
%html | ||
%head | ||
%meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"} | ||
%title Highstock Example | ||
%script{:src => "http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", :type => "text/javascript"} | ||
:javascript | ||
$(function() { | ||
$.get('data.csv', function(csv, state, xhr) { | ||
|
||
// inconsistency | ||
if (typeof csv != 'string') { | ||
csv = xhr.responseText; | ||
} | ||
|
||
// parse the CSV data | ||
var data = [], header, comment = /^#/, x; | ||
|
||
$.each(csv.split('\n'), function(i, line){ | ||
if (!comment.test(line)) { | ||
if (!header) { | ||
header = line; | ||
} | ||
else { | ||
var point = line.split(';'), | ||
date = point[0].split('-'); | ||
|
||
if (point.length > 1) { | ||
x = Date.UTC(date[2], date[1] - 1, date[0]); | ||
|
||
data.push([ | ||
x, // time | ||
parseFloat(point[4]) // close | ||
]); | ||
} | ||
} | ||
} | ||
}); | ||
|
||
|
||
// Create the chart | ||
window.chart = new Highcharts.StockChart({ | ||
chart: { | ||
renderTo: 'container' | ||
}, | ||
|
||
rangeSelector: { | ||
selected: 1 | ||
}, | ||
|
||
title: { | ||
text: 'USD to EUR exchange rate' | ||
}, | ||
|
||
xAxis: { | ||
maxZoom: 14 * 24 * 3600000 // fourteen days | ||
}, | ||
yAxis: { | ||
title: { | ||
text: 'Exchange rate' | ||
} | ||
}, | ||
|
||
series: [{ | ||
name: 'USD to EUR', | ||
data: data, | ||
type: 'areaspline', | ||
threshold: null | ||
}] | ||
}); | ||
}); | ||
}); | ||
%body | ||
%script{:src => "../../js/highstock.js", :type => "text/javascript"} | ||
#container{:style => "height: 500px"} |
42 changes: 42 additions & 0 deletions
42
app/views/graphics/highcharts/_tmp/highstock/_stock_basic_line.js.haml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
!!! | ||
%html | ||
%head | ||
%meta{:content => "text/html; charset=utf-8", "http-equiv" => "Content-Type"} | ||
%title Highstock Example | ||
%script{:src => "http://ajax.googleapis.com/ajax/libs/jquery/1.6.1/jquery.min.js", :type => "text/javascript"} | ||
:javascript | ||
jQuery(function() { | ||
// Create the chart | ||
window.chart = new Highcharts.StockChart({ | ||
chart: { | ||
renderTo: 'container' | ||
}, | ||
|
||
rangeSelector: { | ||
selected: 1 | ||
}, | ||
|
||
title: { | ||
text: 'USD to EUR exchange rate' | ||
}, | ||
|
||
xAxis: { | ||
maxZoom: 14 * 24 * 3600000 // fourteen days | ||
}, | ||
yAxis: { | ||
title: { | ||
text: 'Exchange rate' | ||
} | ||
}, | ||
|
||
series: [{ | ||
name: 'USD to EUR', | ||
data: usdeur | ||
}] | ||
}); | ||
}); | ||
%body | ||
%script{:src => "../../js/highstock.js", :type => "text/javascript"} | ||
%script{:src => "../../js/modules/exporting.js", :type => "text/javascript"} | ||
%script{:src => "http://www.highcharts.com/samples/data/usdeur.js", :type => "text/javascript"} | ||
#container{:style => "height: 500px"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
- content_for :head_stylesheets do | ||
%title OpenLayers Google Layer Example | ||
%link{:href => "http://openlayers.org/dev/examples/../theme/default/style.css", :rel => "stylesheet", :type => "text/css"}/ | ||
%link{:href => "http://openlayers.org/dev/examples/../theme/default/google.css", :rel => "stylesheet", :type => "text/css"}/ | ||
%link{:href => "http://openlayers.org/dev/examples/style.css", :rel => "stylesheet", :type => "text/css"}/ | ||
/ this gmaps key generated for http://openlayers.org/dev/ | ||
|
||
- content_for :head_scripts do | ||
%script{:src => "http://maps.google.com/maps?file=api"} | ||
%script{:src => "http://openlayers.org/dev/examples/../OpenLayers.js"} | ||
:javascript | ||
var map; | ||
|
||
$(function() { | ||
map = new OpenLayers.Map('map'); | ||
map.addControl(new OpenLayers.Control.LayerSwitcher()); | ||
|
||
var gphy = new OpenLayers.Layer.Google( | ||
"Google Physical", | ||
{type: G_PHYSICAL_MAP} | ||
); | ||
var gmap = new OpenLayers.Layer.Google( | ||
"Google Streets", // the default | ||
{numZoomLevels: 20} | ||
); | ||
var ghyb = new OpenLayers.Layer.Google( | ||
"Google Hybrid", | ||
{type: G_HYBRID_MAP, numZoomLevels: 20} | ||
); | ||
var gsat = new OpenLayers.Layer.Google( | ||
"Google Satellite", | ||
{type: G_SATELLITE_MAP, numZoomLevels: 22} | ||
); | ||
|
||
|
||
map.addLayers([gphy, gmap, ghyb, gsat]); | ||
|
||
map.setCenter(new OpenLayers.LonLat(10.2, 48.9), 5); | ||
|
||
$("#Selector").selectmenu({style: 'popup',width: 300,menuWidth:300,maxHeight:240}); | ||
}); | ||
|
||
- content_for :license do | ||
= render :partial => "ui/license" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.