Variable passed to BarChart by OokTech not working

Hello all,

I’m trying to use the Bar Chart plugin from OokTech found here BarChart Demo Edition — a demo of the plugin
with a variable. Below is my code. I’ve tried all of the different ways of passing a variable that I know of (<variable>, $(varaible)$, etc. But none have worked. I’ve even tried using the transclude widget, but that doesn’t seem to run the ProgressBar plugin at all. I know I’m missing something, but have no idea what it might be. By the way, if I just put a number instead of the variable ([550] instead of ), then it works just fine. Help, please!

<fieldset class="rw-fieldset-right-gap">
  <legend class="rw-legend"># of AM Stations by Frequency (10 kHz spacing)</legend>
  <table class="dx-table bct">
    <tr>
      <th>Freq<br>(kHz)</th>
      <th>Count</th>
      <th>Bar</th>
      <th>Stations</th>
    </tr>
    <$list filter="[tag[DXLog]field:dx-class[MWBC]get[dx-freq-khz]unique[]nsort[]]" variable="freq">
      <tr>
        <td><$text text=<<freq>>/></td>
        <td><$count filter="[tag[DXLog]dx-class[MWBC]dx-freq-khz<freq>get[dx-station]unique[]]"/></td>
        <td style="width: 10%;">
          <$ProgressBar
            filters="[tag[DXLog]dx-class[MWBC]dx-freq-khz<freq>get[dx-station]unique[]],[title[Bar Chart Max]get[text]split[ ]]"
            colors="#5B6F55,#f1ebda"
            class=""
            height="0.6"
            height-unit="em"
            label=""
          />
        </td>
        <td>
          <$list filter="[tag[DXLog]field:dx-class[MWBC]field:dx-freq-khz<freq>sort[dx-station]get[dx-station]unique[]]" variable="station">
            <$link to=<<station>> />&nbsp;&nbsp;
          </$list>
        </td>
      </tr>
    </$list>
  </table>
</fieldset>

Hi @HistoryBuff , can you point to the variable you are talking about (which is not working) inside your example? There are many variables…

There is only one variable, freq, defined. It’s defined by the list widget and I am trying to pass that variable in the ProgressBar plugin.

So I gave up on trying to use the Progress Bar plugin. I just could not find a way to pass a variable to it. The code below is what I ended up with. I used the HTML progress tag instead. I had to use the define at the top because having <progress value=<> max=“30”> instead of <> messed up the table and it wouldn’t display the next table cell. Not sure why since I didn’t spend a lot of time debugging it. The code below works great, but I would be interested in understanding why I need to define bar.

\define bar()
  <progress value=<<stcount>> max="30">
\end

<fieldset class="rw-fieldset-right-gap">
  <legend class="rw-legend"># of AM Stations by Frequency (10 kHz spacing)</legend>
  <table class="dx-table bct">
    <tr>
      <th>Freq<br>(kHz)</th>
      <th>Count</th>
      <th>Bar</th>
      <th>Stations</th>
    </tr>
    <$list filter="[tag[DXLog]field:dx-class[MWBC]get[dx-freq-khz]unique[]nsort[]]" variable="freq">
      <tr>
        <$let stcount={{{ [tag[DXLog]dx-class[MWBC]dx-freq-khz<freq>get[dx-station]unique[]count[]] }}} >
          <td><$text text=<<freq>>/></td>
          <td><<stcount>></td>
          <td style="width: 10%;">
            <<bar>>
          </td>
          <td>
            <$list filter="[tag[DXLog]field:dx-class[MWBC]field:dx-freq-khz<freq>sort[dx-station]get[dx-station]unique[]]" variable="station">
              <$link to=<<station>> />&nbsp;&nbsp;
            </$list>
          </td>
        </$let>
      </tr>
    </$list>
  </table>
</fieldset>

You need to close the progress element. Use either

<progress value=<<stcount>> max="30"></progress>

or

<progress value=<<stcount>> max="30"/>

Note: the reason the macro definition worked is because anything left open is automatically closed when the \end of the macro is reached.

-e

Of course! Thanks so much! That was a brain fart for sure!