Mining-Profit  > API&Tools  >  Bitcoin Chart

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().

  1. <script src="https://mining-profit.com/js/mp-btc-chart.js"></script>
  2. <script type="text/javascript">
  3.     MiningProfitBTCChart.draw();
  4. </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:

  1. MiningProfitBTCChart.setMajorColor('#428bca'); //right
  2. MiningProfitBTCChart.setMajorColor('#428bcaa1'); //incorrect
  3. //or
  4. MiningProfitBTCChart.setMajorColor('rgb(170, 96, 54)'); //right
  5. //or
  6. 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:

  1. MiningProfitBTCChart.setChartWidth(566);
  2. //or
  3. MiningProfitBTCChart.setChartWidth(1000);

MiningProfitBTCChart.setChartHeight(int HeightChart);

The module height at pixel.

Please, consider the following:

Default: 390.

Examples:

  1. MiningProfitBTCChart.setChartWidth(450);
  2. //or
  3. 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:

Default: ['6h', '12h', '1d', '1w', '1m', '3m', '1y', 'All'].

Examples:

  1. MiningProfitBTCChart.setChartRanges(['20h', '3h', '1d', '1w', '1m', '2m', '1y', 'All']);
  2. //or
  3. 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:

Default: '1d'.

Examples:

  1. MiningProfitBTCChart.setInitialRange('6h');
  2. //or
  3. MiningProfitBTCChart.setInitialRange('2d');

The btcChart settings examples.

  1. <script src="https://mining-profit.com/js/mp-btc-chart.js"></script>
  2. <script type="text/javascript">
  3.     MiningProfitBTCChart.setChartWidth(550);
  4.     MiningProfitBTCChart.setChartHeight(400);
  5.     MiningProfitBTCChart.isDisplayControlRanges(true);
  6.     MiningProfitBTCChart.isDisplayControlInterval(false);
  7.     MiningProfitBTCChart.setInitialRange('20h');
  8.     MiningProfitBTCChart.setChartRanges(['6h', '10h', '20h', '2d', '1w', '2w', '1m']);
  9.     MiningProfitBTCChart.setMajorColor('rgb(35, 119, 58)');
  10.     MiningProfitBTCChart.draw();
  11. </script>