Skip to content

Commit e9f63bf

Browse files
authored
Merge pull request #3 from edro15/master
Major changes to OHLC Chart Viz
2 parents 972c538 + b7a1431 commit e9f63bf

28 files changed

+134705
-112665
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
node-modules/
2-
package-lock.json
32
.DS_Store

AUTHORS.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
=======
2+
Credits
3+
=======
4+
5+
This project was created for a summer internship at Splunk in 2018.
6+
7+
Project Manager
8+
-----------------
9+
* Tyler Muth `@tmuth <https://github.com/tmuth>`_
10+
11+
Authors
12+
-----------------
13+
* Tamar A. Zamba `@tzamba <https://github.com/tzamba>`_
14+
* Erica Pescio `@edro15 <https://github.com/edro15>`_
15+
16+
Contributors
17+
-----------------
18+
* Mayur Pipaliya `@mayurah <https://github.com/mayurah>`_
19+
* Ankit Bhagat `@xynazog <https://github.com/xynazog>`_

LICENSE.md

Lines changed: 51 additions & 0 deletions
Large diffs are not rendered by default.

OHLC_bars.png

158 KB
Loading

OHLC_candlestick.png

147 KB
Loading

README.md

Lines changed: 44 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,44 @@
1-
# Plotly.js Custom Vizualization Project - Splunk SE Summer Internship 2018
2-
The [plotly.js](https://github.com/plotly/plotly.js/) charting library has been packaged into a Splunk application to expose the charts via the Splunk Custom Visualization Framework
1+
# Plotly.js Custom Visualizations
2+
A collection of Splunk modular visualizations based on [plotly.js](https://github.com/plotly/plotly.js/), a JavaScript open-source library used to create interactive charts for finance, engineering and sciences.
33

4-
Tamar A. Zamba - Lead Developer
5-
SE Intern, Plano, TX
6-
7-
Tyler Muth - Project Manager
8-
Analytics Architect, Washington, D.C.
9-
10-
This modular visualization app includes:
11-
1. Candlestick/OHLC Chart - for Stocks and Financial Data. [Candlestick/OHLC source code](https://github.com/tmuth/plotly_custom_viz_splunk/blob/master/appserver/static/visualizations/candlestick_chart/src/visualization_source.js)
12-
2. Box Plot Chart - for displaying Statistical Data. [BoxPlot source code](https://github.com/tmuth/plotly_custom_viz_splunk/blob/master/appserver/static/visualizations/boxplot/src/visualization_source.js)
4+
Visualizations included into this collection:
5+
* OHLC Chart - for Stocks and Financial Data ([source code](appserver/static/visualizations/ohlc/src/visualization_source.js))
6+
* Box Plot Chart - for Statistical Data ([source code](appserver/static/visualizations/boxplot/src/visualization_source.js))
137

148
## Installation
159
- [Download Splunk for your platform](http://www.splunk.com/download?r=productOverview).
1610
- Unpack/Install Splunk by running the downloaded files.
1711
- Follow the instruction on the screen.
1812

19-
Download the app **plotly_custom_viz_splunk** from **GitHub** and installed in your Splunk platform. Access your Splunk instance via terminal and:
13+
**plotly_custom_viz_splunk** can be downloaded from **GitHub** and installed in your Splunk platform. Access your Splunk instance via terminal and:
2014
- browse to your apps directory `$SPLUNK_HOME/etc/apps/`
2115
- download the app from github `git clone https://github.com/tmuth/plotly_custom_viz_splunk`
2216
- Restart splunk to apply changes `$SPLUNK_HOME/bin/splunk restart`
2317

2418
## Usage
25-
Sample SPL Search for Candlestick/OHLC:
19+
* Type your search
20+
* Click on tab `Visualization` and then select either `OHLC Chart` or `Box Plot` among available visualizations
21+
* Format the visualization as needed
22+
23+
### OHLC Chart
24+
`<basesearch> | table _time open close high low [currencypair] [8pointEMA] [20pointEMA] [4pointSMA]`
25+
26+
If not provided, default values will be used for optional fields `currencypair`, `8pointEMA`, `20pointEMA` and `4pointEMA`.
27+
28+
> Field names **must** correspond to the ones specified above to be properly handled by the visualization
29+
30+
### Box Plot
31+
`<basesearch> | table box_name value`
32+
33+
Replace `box_name` and `value` with your fields to start.
34+
35+
| FieldName | Format | Description | Example |
36+
|-------------|---------|--------------------------|-----------|
37+
| `box_name` | string | Label of the box | `A` |
38+
| `value` | numeric | Data forming box dataset | `20` |
39+
40+
## Examples
41+
Sample SPL Search for OHLC:
2642

2743
```sh
2844
| makeresults count=60
@@ -36,8 +52,18 @@ Sample SPL Search for Candlestick/OHLC:
3652
| eval high=if(open > close,(open*.1)+open,(close*.1)+close)
3753
| eval low=if(open < close,open-(open*.1),close-(close*.1))
3854
| fields - sign,count
55+
| sort _time
56+
| trendline ema8(close) AS 8PointEMA ema20(close) AS 20PointEMA
57+
| reverse
3958
```
4059

60+
OHLC - Candlestick
61+
62+
![alt text](OHLC_candlestick.png "OHLC Chart - Candlestick")
63+
64+
OHLC - Bars
65+
66+
![alt text](OHLC_bars.png "OHLC Chart - Bars")
4167

4268
Sample SPL Search for BoxPlot:
4369

@@ -49,3 +75,8 @@ Sample SPL Search for BoxPlot:
4975
| eval y=random() %51
5076
| fields - _time
5177
```
78+
79+
![alt text](boxplot_chart.png "Boxplot Chart")
80+
81+
## License
82+
This project is licensed under [Splunk Pre-Release Software License Agreement](LICENSE.md).

README/savedsearches.conf.spec

Lines changed: 10 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,17 @@
11
# Declare properties here
2-
display.visualizations.custom.candlestick_chart.line_chart.xAngle = <float>;
3-
display.visualizations.custom.candlestick_chart.line_chart.yAngle = <float>;
2+
display.visualizations.custom.ohlc.line_chart.showLegend = <number>;
3+
display.visualizations.custom.ohlc.line_chart.chartType = <string>;
4+
display.visualizations.custom.ohlc.line_chart.mbDisplay = <number>;
45

5-
display.visualizations.custom.candlestick_chart.line_chart.mbDisplay = <string>;
6+
display.visualizations.custom.ohlc.line_chart.xAxisName = <string>;
7+
display.visualizations.custom.ohlc.line_chart.xAngle = <float>;
8+
display.visualizations.custom.ohlc.line_chart.showRSlider = <number>;
69

7-
display.visualizations.custom.candlestick_chart.line_chart.xAxisName = <string>;
8-
display.visualizations.custom.candlestick_chart.line_chart.yAxisName = <string>;
10+
display.visualizations.custom.ohlc.line_chart.yAxisName = <string>;
11+
display.visualizations.custom.ohlc.line_chart.yAngle = <float>;
912

10-
display.visualizations.custom.candlestick_chart.line_chart.highColor = <string>;
11-
display.visualizations.custom.candlestick_chart.line_chart.lowColor = <string>;
12-
13-
display.visualizations.custom.candlestick_chart.line_chart.showRSlider = <string>;
14-
15-
display.visualizations.custom.candlestick_chart.line_chart.showHigh= <string>;
16-
display.visualizations.custom.candlestick_chart.line_chart.showLow = <string>;
17-
18-
display.visualizations.custom.candlestick_chart.line_chart.thColor = <string>;
19-
display.visualizations.custom.candlestick_chart.line_chart.tlColor = <string>;
20-
21-
display.visualizations.custom.candlestick_chart.line_chart.chartType = <string>;
22-
23-
display.visualizations.custom.candlestick_chart.line_chart.showLegend = <string>;
13+
display.visualizations.custom.ohlc.line_chart.showEMA = <string>;
14+
display.visualizations.custom.ohlc.line_chart.showSMA = <string>;
2415

2516

2617

0 commit comments

Comments
 (0)