Bitcoin Chart External Module
Description
If you think that it would be a good thing to reflect the dynamic of a price change for your website visitors, then our module is exactly what you′re looking for. Easy settings, informative and handy – it will catch the interest of your users and make your resource more attractive.
The module looks like this in a standard settings:
Module is made up of 3 blocks: the buttons of interval choice, areas for convenient interval display and, basically, the graphic. The graphic block is built in any way, but it depends only on you what you would show with the additional parts. It′s all defined through the settings.
Module doesn′t make the undue traffic for the page, being regularly updated. The update launches only when it′s necessary and you will see a new data on a graphic right off.
The graphic is made up with the help of the Google Charts tools.
Quick Connection
In order to plug in the module in a standard form (example is above), it will be sufficient to add a script, such as below, into your code. The plugin will be integrated where you will call the following function – MiningProfitBTCChart.draw().
- <script src="https://mining-profit.com/js/mp-btc-chart.js"></script>
- <script type="text/javascript">
- MiningProfitBTCChart.draw();
- </script>
Plugin Settings
All the features are optional. In case of module embedding without any custom settings (Quick Connection), the btcChart will appear in its official theme Mining-Profit.com.
All settings should be customized before you run btcChart rendering function (MiningProfitBTCChart.draw()).
All the options defined after this function can harm the module functioning.
MiningProfitBTCChart.isDisplayControlRanges(boolean Flag);
With the help of this function you can determine whether you should make up the block of interval switching.
Default: true.
MiningProfitBTCChart.isDisplayControlInterval(boolean Flag);
With the help of this function you can determine whether you should make up the block of interval reflection (by date).
Pay attention that the present block reflects the timestamps for the small time intervals too.
In the next iterations of module development, the users are provided with the possibility of interval choice due to this block (as the in-built calendar).
Default: true.
MiningProfitBTCChart.setMajorColor(string MajorColor);
The btcChart color setting. The main color for all the module blocks.
Please, pay attention that you can set the color in several formats (select the most convenient for you): hexadecimal color, RGB format or color name (color list is shown below).
If the option is set with mistake, the module will be reflected in a standard color. That′s why, if you don′t see that expected result after the color set then please, check this option one more time.
Default: '#428bca'.
Examples:
- MiningProfitBTCChart.setMajorColor('#428bca'); //right
- MiningProfitBTCChart.setMajorColor('#428bcaa1'); //incorrect
- //or
- MiningProfitBTCChart.setMajorColor('rgb(170, 96, 54)'); //right
- //or
- MiningProfitBTCChart.setMajorColor('teal'); //right
The list of the possible color names: 'blue', 'gray', 'black', 'silver', 'red', 'maroon', 'yellow', 'olive', 'lime', 'green', 'aqua', 'teal', 'navy', 'fuchsia', 'purple'.
MiningProfitBTCChart.setChartWidth(int WidthChart);
The module width is at pixel.
Please, pay attention that the width cannot be set with less than 300 pixels.
Default: 750.
Examples:
- MiningProfitBTCChart.setChartWidth(566);
- //or
- MiningProfitBTCChart.setChartWidth(1000);
MiningProfitBTCChart.setChartHeight(int HeightChart);
The module height at pixel.
Please, consider the following:
- The height cannot be set with less than 200 pixels.
- The specified height is the general height of module and not only of the graphic. If you don′t turn off the blocks of the graphic operation, then the part of the specified height will be presented to them. Besides, the location of the operational blocks can be changed with the little width and they will “take away” more height.
Default: 390.
Examples:
- MiningProfitBTCChart.setChartWidth(450);
- //or
- MiningProfitBTCChart.setChartWidth(600);
MiningProfitBTCChart.setChartRanges(Array ListStringsRanges);
The array of intervals that will be shown in the block of interval switching. The interval is indicated with the line.
The line of the interval name is made up with the following rule:
range = range_digit + range_name, where
range_digit: is any whole number
range_name: 'h' - hour; 'd'-day; 'w' - week; 'm' - month; 'y' - year; 'All' – the whole time interval (since the boitcoin’s creation).
The range examples: 12h, 3d, 2w, 1m, 2m, 5m, 1y.
Please, consider the following:
- If the option MiningProfitBTCChart.isDisplayControlInterval(boolean Flag) is installed in false, then the present setting won′t be relevant and won′t be applied.
- The intervals will be reflected in the order you selected.
- Incorrect and repeating intervals will be deleted.
Default: ['6h', '12h', '1d', '1w', '1m', '3m', '1y', 'All'].
Examples:
- MiningProfitBTCChart.setChartRanges(['20h', '3h', '1d', '1w', '1m', '2m', '1y', 'All']);
- //or
- MiningProfitBTCChart.setChartRanges(['12h', '3d', '2w', '1m', '2m', '5m', '1y']);
MiningProfitBTCChart.setInitialRange(string InitialRange);
The starting range where graphic will be built while loading.
The interval name is made up following the rules above (there will be a link above).
Please, consider the following:
- If the starting range is not presented in the module intervals list (a standard one or set through the option MiningProfitBTCChart.setChartRanges()), then instead of it we take the first element from this list.
- The option of starting range is always actual, even despite the operational module blocks are reflected or not. In a case, when the starting range is indicated correctly and the block of the interval switching is turned off, then the previous rule of the “presence in an interval list” is declined.
Default: '1d'.
Examples:
- MiningProfitBTCChart.setInitialRange('6h');
- //or
- MiningProfitBTCChart.setInitialRange('2d');
The btcChart settings examples.
- <script src="https://mining-profit.com/js/mp-btc-chart.js"></script>
- <script type="text/javascript">
- MiningProfitBTCChart.setChartWidth(550);
- MiningProfitBTCChart.setChartHeight(400);
- MiningProfitBTCChart.isDisplayControlRanges(true);
- MiningProfitBTCChart.isDisplayControlInterval(false);
- MiningProfitBTCChart.setInitialRange('20h');
- MiningProfitBTCChart.setChartRanges(['6h', '10h', '20h', '2d', '1w', '2w', '1m']);
- MiningProfitBTCChart.setMajorColor('rgb(35, 119, 58)');
- MiningProfitBTCChart.draw();
- </script>