When setting up bar charts, it may be necessary to create a bar chart that covers only a certain area of data rather than a record that comes from the start of the graph. This is possible, but rather than using a single bar chart, a series of multiple bar charts have to be set up to create the effect, similar to the following;
In the example below, we will look at a simple new column created in the main Geology table that details soil strength through value between 1 and 3. This example is only for illustration purposes and is not indicative or any real world data in anyway. The example new field has been setup as follows;
First of all, we will need to setup the column to be able to support a bar chart. In this example I will edit an edited version of the standard borehole template to include this data. I have inserted a column, with 3 blank sub columns underneath that matches the parents dimensions and the relevant header has then been inserted in the column header.
We will not setup the first column of data. This will show a black bar in the first column, each time that a 1 value appears within the first column. Click on the Bar Chart option to bring in the bar chart.
Set the values as following;
The expression needed is;
if([StratumDetails.Soil Strength]=1,numberordefault(1,1),numberordefault(0,0))
(Ensure that Increment and Count is set to 1 and Enable Scale is switched off)
We will then need to edit the style of the bar chart. Browse through to the Appearance tab and select Styles, then select the Background tab. Select the black colour.
Repeat the above steps for the 2nd and 3rd columns. The expressions needed are as follows;
2nd Column
if([StratumDetails.Soil Strength]=2,numberordefault(1,1),numberordefault(0,0))
3rd Column
if([StratumDetails.Soil Strength]=3,numberordefault(1,1),numberordefault(0,0))
That should then produce an output compared to what was required;
The style of the barcharts can then be adjusted to match the requirements needed. For example, the colour could be changed or the transparency etc. This can also be expanded for a large number of possible values or even a picklist item. Just edit the [XXX] item below to be whatever the target value is;
if([StratumDetails.Soil Strength]=[XXX],numberordefault(1,1),numberordefault(0,0))
For example, if you wanted the bar to show for results that match the picklist value EH, then place the following;
if([StratumDetails.Soil Strength]='EH',numberordefault(1,1),numberordefault(0,0))